git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@675996 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -17,7 +17,10 @@ | |||||
| */ | */ | ||||
| package org.apache.tools.ant.property; | package org.apache.tools.ant.property; | ||||
| /** Interface to a class (normally PropertyHelper) to get a property */ | |||||
| /** | |||||
| * Interface to a class (normally PropertyHelper) to get a property. | |||||
| * @since Ant 1.8.0 | |||||
| */ | |||||
| public interface GetProperty { | public interface GetProperty { | ||||
| /** | /** | ||||
| * Returns the value of a property if it is set. | * Returns the value of a property if it is set. | ||||
| @@ -17,7 +17,10 @@ | |||||
| */ | */ | ||||
| package org.apache.tools.ant.property; | package org.apache.tools.ant.property; | ||||
| /** Class to represent a null and to stop the chain of lookups. */ | |||||
| /** | |||||
| * Class to represent a null and to stop the chain of lookups. | |||||
| * @since Ant 1.8.0 | |||||
| */ | |||||
| public final class NullReturn { | public final class NullReturn { | ||||
| /** a value to use in a property helper to stop looking properties */ | /** a value to use in a property helper to stop looking properties */ | ||||
| public static final NullReturn NULL = new NullReturn(); | public static final NullReturn NULL = new NullReturn(); | ||||
| @@ -25,5 +28,11 @@ public final class NullReturn { | |||||
| /** Private constructor */ | /** Private constructor */ | ||||
| private NullReturn() { | private NullReturn() { | ||||
| } | } | ||||
| } | |||||
| /** | |||||
| * {@inheritDoc} | |||||
| */ | |||||
| public String toString() { | |||||
| return String.valueOf(null); | |||||
| } | |||||
| } | |||||
| @@ -21,7 +21,10 @@ import java.text.ParsePosition; | |||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| /** Interface to parse a property */ | |||||
| /** | |||||
| * Interface to parse a property. | |||||
| * @since Ant 1.8.0 | |||||
| */ | |||||
| public interface ParseNextProperty { | public interface ParseNextProperty { | ||||
| /** | /** | ||||
| * Get the current project. | * Get the current project. | ||||
| @@ -24,6 +24,7 @@ import org.apache.tools.ant.Project; | |||||
| /** | /** | ||||
| * Parse properties using a collection of expanders. | * Parse properties using a collection of expanders. | ||||
| * @since Ant 1.8.0 | |||||
| */ | */ | ||||
| public class ParseProperties implements ParseNextProperty { | public class ParseProperties implements ParseNextProperty { | ||||
| @@ -37,8 +38,7 @@ public class ParseProperties implements ParseNextProperty { | |||||
| * @param expanders a sequence of exapanders | * @param expanders a sequence of exapanders | ||||
| * @param getProperty property resolver. | * @param getProperty property resolver. | ||||
| */ | */ | ||||
| public ParseProperties( | |||||
| Project project, Collection expanders, GetProperty getProperty) { | |||||
| public ParseProperties(Project project, Collection expanders, GetProperty getProperty) { | |||||
| this.project = project; | this.project = project; | ||||
| this.expanders = expanders; | this.expanders = expanders; | ||||
| this.getProperty = getProperty; | this.getProperty = getProperty; | ||||
| @@ -21,7 +21,10 @@ import org.apache.tools.ant.PropertyHelper; | |||||
| import java.text.ParsePosition; | import java.text.ParsePosition; | ||||
| /** Interface to a class (normally PropertyHelper) to get a property */ | |||||
| /** | |||||
| * Interface to a class (normally PropertyHelper) to get a property. | |||||
| * @since Ant 1.8.0 | |||||
| */ | |||||
| public interface PropertyExpander extends PropertyHelper.Delegate { | public interface PropertyExpander extends PropertyHelper.Delegate { | ||||
| /** | /** | ||||
| * Parse the next property name. | * Parse the next property name. | ||||
| @@ -30,7 +33,6 @@ public interface PropertyExpander extends PropertyHelper.Delegate { | |||||
| * @param parseNextProperty parse next property | * @param parseNextProperty parse next property | ||||
| * @return parsed String if any, else <code>null</code>. | * @return parsed String if any, else <code>null</code>. | ||||
| */ | */ | ||||
| String parsePropertyName( | |||||
| String s, ParsePosition pos, ParseNextProperty parseNextProperty); | |||||
| String parsePropertyName(String s, ParsePosition pos, ParseNextProperty parseNextProperty); | |||||
| } | } | ||||
| @@ -27,12 +27,13 @@ import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| /** | /** | ||||
| * Class to resolve properties in a map. | |||||
| * Class to resolve properties in a map. | |||||
| * @since Ant 1.8.0 | |||||
| */ | */ | ||||
| public class ResolvePropertyMap implements GetProperty { | public class ResolvePropertyMap implements GetProperty { | ||||
| private final Set seen = new HashSet(); | |||||
| private final Set seen = new HashSet(); | |||||
| private final ParseProperties parseProperties; | private final ParseProperties parseProperties; | ||||
| private final GetProperty master; | |||||
| private final GetProperty master; | |||||
| private Map map; | private Map map; | ||||
| /** | /** | ||||
| @@ -41,8 +42,7 @@ public class ResolvePropertyMap implements GetProperty { | |||||
| * @param master the master property holder (usually PropertyHelper) | * @param master the master property holder (usually PropertyHelper) | ||||
| * @param expanders a collection of expanders (usually from PropertyHelper). | * @param expanders a collection of expanders (usually from PropertyHelper). | ||||
| */ | */ | ||||
| public ResolvePropertyMap( | |||||
| Project project, GetProperty master, Collection expanders) { | |||||
| public ResolvePropertyMap(Project project, GetProperty master, Collection expanders) { | |||||
| this.master = master; | this.master = master; | ||||
| this.parseProperties = new ParseProperties(project, expanders, this); | this.parseProperties = new ParseProperties(project, expanders, this); | ||||
| } | } | ||||