Fields Summary |
---|
private org.apache.tools.ant.Project | projectThe project to configure. |
private File | buildFileThe configuration file to parse. |
private Vector | targetVectorVector with all the targets, in the order they are
defined. Project maintains a Hashtable, which is not ordered.
This will allow description to know the original order. |
private File | buildFileParentParent directory of the build file. Used for resolving entities
and setting the project's base directory. |
private String | currentProjectNameName of the current project |
private Locator | locatorLocator for the configuration file parser.
Used for giving locations of errors etc. |
private org.apache.tools.ant.Target | implicitTargetTarget that all other targets will depend upon implicitly.
This holds all tasks and data type definitions that have
been placed outside of targets. |
private org.apache.tools.ant.Target | currentTargetCurrent target ( no need for a stack as the processing model
allows only one level of target ) |
private Vector | wStackThe stack of RuntimeConfigurable2 wrapping the
objects. |
private boolean | ignoreProjectTagIndicates whether the project tag attributes are to be ignored
when processing a particular build file. |
private Map | prefixMappingKeeps track of prefix -> uri mapping during parsing |
private Map | currentTargetsKeeps track of targets in files |
Methods Summary |
---|
public void | addTarget(org.apache.tools.ant.Target target)add a new target
targetVector.addElement(target);
currentTarget = target;
|
public void | configureId(java.lang.Object element, org.xml.sax.Attributes attr)Scans an attribute list for the id attribute and
stores a reference to the target object in the project if an
id is found.
This method was moved out of the configure method to allow
it to be executed at parse time.
String id = attr.getValue("id");
if (id != null) {
project.addIdReference(id, element);
}
|
public org.apache.tools.ant.RuntimeConfigurable | currentWrapper()get the current runtime configurable wrapper
can return null
if (wStack.size() < 1) {
return null;
}
return (RuntimeConfigurable) wStack.elementAt(wStack.size() - 1);
|
public void | endPrefixMapping(java.lang.String prefix)End of prefix to uri mapping.
List list = (List) prefixMapping.get(prefix);
if (list == null || list.size() == 0) {
return; // Should not happen
}
list.remove(list.size() - 1);
|
public java.io.File | getBuildFile()find out the build file
return buildFile;
|
public java.io.File | getBuildFileParent()find out the parent build file of this build file
return buildFileParent;
|
public java.lang.String | getCurrentProjectName()find out the current project name
return currentProjectName;
|
public org.apache.tools.ant.Target | getCurrentTarget()get the current target
return currentTarget;
|
public java.util.Map | getCurrentTargets()Get the targets in the current source file.
return currentTargets;
|
public org.apache.tools.ant.Target | getImplicitTarget()get the implicit target
return implicitTarget;
|
public org.xml.sax.Locator | getLocator()access the locator
return locator;
|
public java.lang.String | getPrefixMapping(java.lang.String prefix)prefix to namespace uri mapping
List list = (List) prefixMapping.get(prefix);
if (list == null || list.size() == 0) {
return null;
}
return (String) list.get(list.size() - 1);
|
public org.apache.tools.ant.Project | getProject()find out the project to which this antxml context belongs
return project;
|
public java.util.Vector | getTargets()access the vector of targets
return targetVector;
|
public java.util.Vector | getWrapperStack()access the stack of wrappers
return wStack;
|
public boolean | isIgnoringProjectTag()tells whether the project tag is being ignored
return ignoreProjectTag;
|
public org.apache.tools.ant.RuntimeConfigurable | parentWrapper()get the runtime configurable wrapper of the parent project
can return null
if (wStack.size() < 2) {
return null;
}
return (RuntimeConfigurable) wStack.elementAt(wStack.size() - 2);
|
public void | popWrapper()remove a runtime configurable wrapper from the stack
if (wStack.size() > 0) {
wStack.removeElementAt(wStack.size() - 1);
}
|
public void | pushWrapper(org.apache.tools.ant.RuntimeConfigurable wrapper)add a runtime configurable wrapper to the internal stack
wStack.addElement(wrapper);
|
public void | setBuildFile(java.io.File buildFile)sets the build file to which the XML context belongs
this.buildFile = buildFile;
this.buildFileParent = new File(buildFile.getParent());
implicitTarget.setLocation(new Location(buildFile.getAbsolutePath()));
|
public void | setCurrentProjectName(java.lang.String name)set the name of the current project
this.currentProjectName = name;
|
public void | setCurrentTarget(org.apache.tools.ant.Target target)sets the current target
this.currentTarget = target;
|
public void | setCurrentTargets(java.util.Map currentTargets)Set the map of the targets in the current source file.
this.currentTargets = currentTargets;
|
public void | setIgnoreProjectTag(boolean flag)sets the flag to ignore the project tag
this.ignoreProjectTag = flag;
|
public void | setImplicitTarget(org.apache.tools.ant.Target target)sets the implicit target
this.implicitTarget = target;
|
public void | setLocator(org.xml.sax.Locator locator)sets the locator
this.locator = locator;
|
public void | startPrefixMapping(java.lang.String prefix, java.lang.String uri)Called during parsing, stores the prefix to uri mapping.
List list = (List) prefixMapping.get(prefix);
if (list == null) {
list = new ArrayList();
prefixMapping.put(prefix, list);
}
list.add(uri);
|