Save This Page
Home » apache-ant-1.7.1-src » org.apache.tools » ant » [javadoc | source]
org.apache.tools.ant
public class: ProjectHelper [javadoc | source]
java.lang.Object
   org.apache.tools.ant.ProjectHelper

Direct Known Subclasses:
    ProjectHelperImpl, ProjectHelper2

Configures a Project (complete with Targets and Tasks) based on a XML build file. It'll rely on a plugin to do the actual processing of the xml file. This class also provide static wrappers for common introspection. All helper plugins must provide backward compatibility with the original ant patterns, unless a different behavior is explicitly specified. For example, if namespace is used on the <project> tag the helper can expect the entire build file to be namespace-enabled. Namespaces or helper-specific tags can provide meta-information to the helper, allowing it to use new ( or different policies ). However, if no namespace is used the behavior should be exactly identical with the default helper.
Field Summary
public static final  String ANT_CORE_URI    The URI for ant name space 
public static final  String ANT_CURRENT_URI    The URI for antlib current definitions 
public static final  String ANTLIB_URI    The URI for defined types/tasks - the format is antlib: 
public static final  String ANT_TYPE    Polymorphic attribute 
public static final  String HELPER_PROPERTY    Name of JVM system property which provides the name of the ProjectHelper class to use. 
public static final  String SERVICE_ID    The service identifier in jars which provide Project Helper implementations. 
public static final  String PROJECTHELPER_REFERENCE    name of project helper reference that we add to a project 
Constructor:
 public ProjectHelper() 
Method from org.apache.tools.ant.ProjectHelper Summary:
addLocationToBuildException,   addText,   addText,   configure,   configureProject,   extractNameFromComponentName,   extractUriFromComponentName,   genComponentName,   getContextClassLoader,   getImportStack,   getProjectHelper,   parse,   parsePropertyString,   replaceProperties,   replaceProperties,   storeChild
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tools.ant.ProjectHelper Detail:
 public static BuildException addLocationToBuildException(BuildException ex,
    Location newLocation) 
    Add location to build exception.
 public static  void addText(Project project,
    Object target,
    String text) throws BuildException 
    Adds the content of #PCDATA sections to an element.
 public static  void addText(Project project,
    Object target,
    char[] buf,
    int start,
    int count) throws BuildException 
    Adds the content of #PCDATA sections to an element.
 public static  void configure(Object target,
    AttributeList attrs,
    Project project) throws BuildException 
Deprecated! since - 1.6.x. Use IntrospectionHelper for each property.

    Configures an object using an introspection handler.
 public static  void configureProject(Project project,
    File buildFile) throws BuildException 
    Configures the project with the contents of the specified XML file.
 public static String extractNameFromComponentName(String componentName) 
    extract the element name from a component name
 public static String extractUriFromComponentName(String componentName) 
    extract a uri from a component name
 public static String genComponentName(String uri,
    String name) 
    Map a namespaced {uri,name} to an internal string format. For BC purposes the names from the ant core uri will be mapped to "name", other names will be mapped to uri + ":" + name.
 public static ClassLoader getContextClassLoader() 
Deprecated! since - 1.6.x. Use LoaderUtils.getContextClassLoader()

    JDK1.1 compatible access to the context class loader. Cut & paste from JAXP.
 public Vector getImportStack() 
    EXPERIMENTAL WILL_CHANGE Import stack. Used to keep track of imported files. Error reporting should display the import path.
 public static ProjectHelper getProjectHelper() throws BuildException 
    Discovers a project helper instance. Uses the same patterns as JAXP, commons-logging, etc: a system property, a JDK1.3 service discovery, default.
 public  void parse(Project project,
    Object source) throws BuildException 
    Parses the project file, configuring the project as it goes.
 public static  void parsePropertyString(String value,
    Vector fragments,
    Vector propertyRefs) throws BuildException 
Deprecated! since - 1.6.x. Use PropertyHelper.

    Parses a string containing ${xxx} style property references into two lists. The first list is a collection of text fragments, while the other is a set of string property names. null entries in the first list indicate a property reference from the second list.
 public static String replaceProperties(Project project,
    String value) throws BuildException 
Deprecated! since - 1.6.x. Use project.replaceProperties().

    Replaces ${xxx} style constructions in the given value with the string value of the corresponding properties.
 public static String replaceProperties(Project project,
    String value,
    Hashtable keys) throws BuildException 
Deprecated! since - 1.6.x. Use PropertyHelper.

    Replaces ${xxx} style constructions in the given value with the string value of the corresponding data types.
 public static  void storeChild(Project project,
    Object parent,
    Object child,
    String tag) 
    Stores a configured child element within its parent object.