Browse Source

fmting, add getProject()

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@547411 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 18 years ago
parent
commit
4212c03c3d
1 changed files with 12 additions and 8 deletions
  1. +12
    -8
      src/main/org/apache/tools/ant/PropertyHelper.java

+ 12
- 8
src/main/org/apache/tools/ant/PropertyHelper.java View File

@@ -77,11 +77,10 @@ public class PropertyHelper {

//override facility for subclasses to put custom hashtables in


// -------------------- Hook management --------------------

/**
* Set the project for which this helper is performing property resolution
* Set the project for which this helper is performing property resolution.
*
* @param p the project instance.
*/
@@ -89,6 +88,14 @@ public class PropertyHelper {
this.project = p;
}

/**
* Get this PropertyHelper's Project.
* @return Project
*/
public Project getProject() {
return project;
}

/** There are 2 ways to hook into property handling:
* - you can replace the main PropertyHelper. The replacement is required
* to support the same semantics (of course :-)
@@ -118,12 +125,11 @@ public class PropertyHelper {
* reference. User tasks can also add themselves to the chain, and provide
* dynamic properties.
*
* @param project the project fro which the property helper is required.
* @param project the project for which the property helper is required.
*
* @return the project's property helper.
*/
public static synchronized
PropertyHelper getPropertyHelper(Project project) {
public static synchronized PropertyHelper getPropertyHelper(Project project) {
PropertyHelper helper
= (PropertyHelper) project.getReference(MagicNames.REFID_PROPERTY_HELPER);
if (helper != null) {
@@ -274,7 +280,6 @@ public class PropertyHelper {
if (replacement == null) {
replacement = getProperty(ns, propertyName);
}

if (replacement == null) {
project.log("Property \"" + propertyName
+ "\" has not been set", Project.MSG_VERBOSE);
@@ -457,7 +462,7 @@ public class PropertyHelper {
if (o != null) {
return o;
}
return userProperties.get(name);
return userProperties.get(name);
}


@@ -639,5 +644,4 @@ public class PropertyHelper {
fragments.addElement(value.substring(prev));
}
}

}

Loading…
Cancel
Save