Package org.apache.tools.ant.helper
Class AntXMLContext
- java.lang.Object
- 
- org.apache.tools.ant.helper.AntXMLContext
 
- 
 public class AntXMLContext extends java.lang.ObjectContext information for the ant processing.
- 
- 
Constructor SummaryConstructors Constructor Description AntXMLContext(Project project)constructor
 - 
Method SummaryModifier and Type Method Description voidaddTarget(Target target)add a new targetvoidconfigureId(java.lang.Object element, org.xml.sax.Attributes attr)Scans an attribute list for theidattribute and stores a reference to the target object in the project if an id is found.RuntimeConfigurablecurrentWrapper()get the current runtime configurable wrapper can return nullvoidendPrefixMapping(java.lang.String prefix)End of prefix to uri mapping.java.io.FilegetBuildFile()find out the build filejava.io.FilegetBuildFileParent()find out the parent build file of this build filejava.net.URLgetBuildFileParentURL()find out the parent build file of this build filejava.net.URLgetBuildFileURL()find out the build filejava.lang.StringgetCurrentProjectName()find out the current project nameTargetgetCurrentTarget()get the current targetjava.util.Map<java.lang.String,Target>getCurrentTargets()Get the targets in the current source file.TargetgetImplicitTarget()get the implicit targetorg.xml.sax.LocatorgetLocator()access the locatorjava.lang.StringgetPrefixMapping(java.lang.String prefix)prefix to namespace uri mappingProjectgetProject()find out the project to which this antxml context belongsjava.util.Vector<Target>getTargets()access the vector of targetsjava.util.Vector<RuntimeConfigurable>getWrapperStack()access the stack of wrappersbooleanisIgnoringProjectTag()tells whether the project tag is being ignoredRuntimeConfigurableparentWrapper()get the runtime configurable wrapper of the parent project can return nullvoidpopWrapper()remove a runtime configurable wrapper from the stackvoidpushWrapper(RuntimeConfigurable wrapper)add a runtime configurable wrapper to the internal stackvoidsetBuildFile(java.io.File buildFile)sets the build file to which the XML context belongsvoidsetBuildFile(java.net.URL buildFile)sets the build file to which the XML context belongsvoidsetCurrentProjectName(java.lang.String name)set the name of the current projectvoidsetCurrentTarget(Target target)sets the current targetvoidsetCurrentTargets(java.util.Map<java.lang.String,Target> currentTargets)Set the map of the targets in the current source file.voidsetIgnoreProjectTag(boolean flag)sets the flag to ignore the project tagvoidsetImplicitTarget(Target target)sets the implicit targetvoidsetLocator(org.xml.sax.Locator locator)sets the locatorvoidstartPrefixMapping(java.lang.String prefix, java.lang.String uri)Called during parsing, stores the prefix to uri mapping.
 
- 
- 
- 
Constructor Detail- 
AntXMLContextpublic AntXMLContext(Project project) constructor- Parameters:
- project- the project to which this antxml context belongs to
 
 
- 
 - 
Method Detail- 
setBuildFilepublic void setBuildFile(java.io.File buildFile) sets the build file to which the XML context belongs- Parameters:
- buildFile- ant build file
 
 - 
setBuildFilepublic void setBuildFile(java.net.URL buildFile) throws java.net.MalformedURLExceptionsets the build file to which the XML context belongs- Parameters:
- buildFile- Ant build file
- Throws:
- java.net.MalformedURLException- if parent URL cannot be constructed
- Since:
- Ant 1.8.0
 
 - 
getBuildFilepublic java.io.File getBuildFile() find out the build file- Returns:
- the build file to which the XML context belongs
 
 - 
getBuildFileParentpublic java.io.File getBuildFileParent() find out the parent build file of this build file- Returns:
- the parent build file of this build file
 
 - 
getBuildFileURLpublic java.net.URL getBuildFileURL() find out the build file- Returns:
- the build file to which the xml context belongs
- Since:
- Ant 1.8.0
 
 - 
getBuildFileParentURLpublic java.net.URL getBuildFileParentURL() find out the parent build file of this build file- Returns:
- the parent build file of this build file
- Since:
- Ant 1.8.0
 
 - 
getProjectpublic Project getProject() find out the project to which this antxml context belongs- Returns:
- project
 
 - 
getCurrentProjectNamepublic java.lang.String getCurrentProjectName() find out the current project name- Returns:
- current project name
 
 - 
setCurrentProjectNamepublic void setCurrentProjectName(java.lang.String name) set the name of the current project- Parameters:
- name- name of the current project
 
 - 
currentWrapperpublic RuntimeConfigurable currentWrapper() get the current runtime configurable wrapper can return null- Returns:
- runtime configurable wrapper
 
 - 
parentWrapperpublic RuntimeConfigurable parentWrapper() get the runtime configurable wrapper of the parent project can return null- Returns:
- runtime configurable wrapper of the parent project
 
 - 
pushWrapperpublic void pushWrapper(RuntimeConfigurable wrapper) add a runtime configurable wrapper to the internal stack- Parameters:
- wrapper- runtime configurable wrapper
 
 - 
popWrapperpublic void popWrapper() remove a runtime configurable wrapper from the stack
 - 
getWrapperStackpublic java.util.Vector<RuntimeConfigurable> getWrapperStack() access the stack of wrappers- Returns:
- the stack of wrappers
 
 - 
addTargetpublic void addTarget(Target target) add a new target- Parameters:
- target- target to add
 
 - 
getCurrentTargetpublic Target getCurrentTarget() get the current target- Returns:
- current target
 
 - 
getImplicitTargetpublic Target getImplicitTarget() get the implicit target- Returns:
- implicit target
 
 - 
setCurrentTargetpublic void setCurrentTarget(Target target) sets the current target- Parameters:
- target- current target
 
 - 
setImplicitTargetpublic void setImplicitTarget(Target target) sets the implicit target- Parameters:
- target- the implicit target
 
 - 
getTargetspublic java.util.Vector<Target> getTargets() access the vector of targets- Returns:
- vector of targets
 
 - 
configureIdpublic void configureId(java.lang.Object element, org.xml.sax.Attributes attr)Scans an attribute list for theidattribute 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. - Parameters:
- element- the current element
- attr- attributes of the current element
 
 - 
getLocatorpublic org.xml.sax.Locator getLocator() access the locator- Returns:
- locator
 
 - 
setLocatorpublic void setLocator(org.xml.sax.Locator locator) sets the locator- Parameters:
- locator- locator
 
 - 
isIgnoringProjectTagpublic boolean isIgnoringProjectTag() tells whether the project tag is being ignored- Returns:
- whether the project tag is being ignored
 
 - 
setIgnoreProjectTagpublic void setIgnoreProjectTag(boolean flag) sets the flag to ignore the project tag- Parameters:
- flag- to ignore the project tag
 
 - 
startPrefixMappingpublic void startPrefixMapping(java.lang.String prefix, java.lang.String uri)Called during parsing, stores the prefix to uri mapping.- Parameters:
- prefix- a namespace prefix
- uri- a namespace uri
 
 - 
endPrefixMappingpublic void endPrefixMapping(java.lang.String prefix) End of prefix to uri mapping.- Parameters:
- prefix- the namespace prefix
 
 - 
getPrefixMappingpublic java.lang.String getPrefixMapping(java.lang.String prefix) prefix to namespace uri mapping- Parameters:
- prefix- the prefix to map
- Returns:
- the uri for this prefix, null if not present
 
 - 
getCurrentTargetspublic java.util.Map<java.lang.String,Target> getCurrentTargets() Get the targets in the current source file.- Returns:
- the current targets.
 
 - 
setCurrentTargetspublic void setCurrentTargets(java.util.Map<java.lang.String,Target> currentTargets) Set the map of the targets in the current source file.- Parameters:
- currentTargets- a map of targets.
 
 
- 
 
-