org.apache.tools.ant
Class ProjectHelper

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectHelper

public class ProjectHelper
extends java.lang.Object

Configures a Project (complete with Targets and Tasks) based on a XML build file.

Author:
duncan@x180.com

Method Summary
static void addText(Project project, java.lang.Object target, char[] buf, int start, int end)
          Adds the content of #PCDATA sections to an element.
static void addText(Project project, java.lang.Object target, java.lang.String text)
          Adds the content of #PCDATA sections to an element.
static void configure(java.lang.Object target, org.xml.sax.AttributeList attrs, Project project)
           
static void configureProject(Project project, java.io.File buildFile)
          Configures the Project with the contents of the specified XML file.
static void parsePropertyString(java.lang.String value, java.util.Vector fragments, java.util.Vector propertyRefs)
          This method will parse a string containing ${value} style property values into two lists.
static java.lang.String replaceProperties(Project project, java.lang.String value, java.util.Hashtable keys)
          Replace ${} style constructions in the given value with the string value of the corresponding data types.
static void storeChild(Project project, java.lang.Object parent, java.lang.Object child, java.lang.String tag)
          Stores a configured child element into its parent object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

configureProject

public static void configureProject(Project project,
                                    java.io.File buildFile)
                             throws BuildException
Configures the Project with the contents of the specified XML file.

configure

public static void configure(java.lang.Object target,
                             org.xml.sax.AttributeList attrs,
                             Project project)
                      throws BuildException

addText

public static void addText(Project project,
                           java.lang.Object target,
                           char[] buf,
                           int start,
                           int end)
                    throws BuildException
Adds the content of #PCDATA sections to an element.

addText

public static void addText(Project project,
                           java.lang.Object target,
                           java.lang.String text)
                    throws BuildException
Adds the content of #PCDATA sections to an element.

storeChild

public static void storeChild(Project project,
                              java.lang.Object parent,
                              java.lang.Object child,
                              java.lang.String tag)
Stores a configured child element into its parent object

replaceProperties

public static java.lang.String replaceProperties(Project project,
                                                 java.lang.String value,
                                                 java.util.Hashtable keys)
                                          throws BuildException
Replace ${} style constructions in the given value with the string value of the corresponding data types.
Parameters:
value - the string to be scanned for property references.

parsePropertyString

public static void parsePropertyString(java.lang.String value,
                                       java.util.Vector fragments,
                                       java.util.Vector propertyRefs)
                                throws BuildException
This method will parse a string containing ${value} style property values 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.


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.