Package org.apache.tools.ant.helper
Class AntXMLContext
java.lang.Object
org.apache.tools.ant.helper.AntXMLContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add a new targetvoid
configureId
(Object element, Attributes attr) Scans an attribute list for theid
attribute and stores a reference to the target object in the project if an id is found.get the current runtime configurable wrapper can return nullvoid
endPrefixMapping
(String prefix) End of prefix to uri mapping.find out the build filefind out the parent build file of this build filefind out the parent build file of this build filefind out the build filefind out the current project nameget the current targetGet the targets in the current source file.get the implicit targetaccess the locatorgetPrefixMapping
(String prefix) prefix to namespace uri mappingfind out the project to which this antxml context belongsaccess the vector of targetsaccess the stack of wrappersboolean
tells whether the project tag is being ignoredget the runtime configurable wrapper of the parent project can return nullvoid
remove a runtime configurable wrapper from the stackvoid
pushWrapper
(RuntimeConfigurable wrapper) add a runtime configurable wrapper to the internal stackvoid
setBuildFile
(File buildFile) sets the build file to which the XML context belongsvoid
setBuildFile
(URL buildFile) sets the build file to which the XML context belongsvoid
setCurrentProjectName
(String name) set the name of the current projectvoid
setCurrentTarget
(Target target) sets the current targetvoid
setCurrentTargets
(Map<String, Target> currentTargets) Set the map of the targets in the current source file.void
setIgnoreProjectTag
(boolean flag) sets the flag to ignore the project tagvoid
setImplicitTarget
(Target target) sets the implicit targetvoid
setLocator
(Locator locator) sets the locatorvoid
startPrefixMapping
(String prefix, String uri) Called during parsing, stores the prefix to uri mapping.
-
Constructor Details
-
AntXMLContext
constructor- Parameters:
project
- the project to which this antxml context belongs to
-
-
Method Details
-
setBuildFile
sets the build file to which the XML context belongs- Parameters:
buildFile
- ant build file
-
setBuildFile
sets the build file to which the XML context belongs- Parameters:
buildFile
- Ant build file- Throws:
MalformedURLException
- if parent URL cannot be constructed- Since:
- Ant 1.8.0
-
getBuildFile
find out the build file- Returns:
- the build file to which the XML context belongs
-
getBuildFileParent
find out the parent build file of this build file- Returns:
- the parent build file of this build file
-
getBuildFileURL
find out the build file- Returns:
- the build file to which the xml context belongs
- Since:
- Ant 1.8.0
-
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
-
getProject
find out the project to which this antxml context belongs- Returns:
- project
-
getCurrentProjectName
find out the current project name- Returns:
- current project name
-
setCurrentProjectName
set the name of the current project- Parameters:
name
- name of the current project
-
currentWrapper
get the current runtime configurable wrapper can return null- Returns:
- runtime configurable wrapper
-
parentWrapper
get the runtime configurable wrapper of the parent project can return null- Returns:
- runtime configurable wrapper of the parent project
-
pushWrapper
add a runtime configurable wrapper to the internal stack- Parameters:
wrapper
- runtime configurable wrapper
-
popWrapper
public void popWrapper()remove a runtime configurable wrapper from the stack -
getWrapperStack
access the stack of wrappers- Returns:
- the stack of wrappers
-
addTarget
-
getCurrentTarget
-
getImplicitTarget
-
setCurrentTarget
sets the current target- Parameters:
target
- current target
-
setImplicitTarget
sets the implicit target- Parameters:
target
- the implicit target
-
getTargets
-
configureId
Scans an attribute list for theid
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.
- Parameters:
element
- the current elementattr
- attributes of the current element
-
getLocator
-
setLocator
-
isIgnoringProjectTag
public boolean isIgnoringProjectTag()tells whether the project tag is being ignored- Returns:
- whether the project tag is being ignored
-
setIgnoreProjectTag
public void setIgnoreProjectTag(boolean flag) sets the flag to ignore the project tag- Parameters:
flag
- to ignore the project tag
-
startPrefixMapping
-
endPrefixMapping
End of prefix to uri mapping.- Parameters:
prefix
- the namespace prefix
-
getPrefixMapping
-
getCurrentTargets
-
setCurrentTargets
-