org.apache.tools.ant.helper

Class AntXMLContext

public class AntXMLContext extends Object

Context information for the ant processing.
Constructor Summary
AntXMLContext(Project project)
constructor
Method Summary
voidaddTarget(Target target)
add a new target
voidconfigureId(Object element, 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.
RuntimeConfigurablecurrentWrapper()
get the current runtime configurable wrapper can return null
voidendPrefixMapping(String prefix)
End of prefix to uri mapping.
FilegetBuildFile()
find out the build file
FilegetBuildFileParent()
find out the parent build file of this build file
URLgetBuildFileParentURL()
find out the parent build file of this build file
URLgetBuildFileURL()
find out the build file
StringgetCurrentProjectName()
find out the current project name
TargetgetCurrentTarget()
get the current target
MapgetCurrentTargets()
Get the targets in the current source file.
TargetgetImplicitTarget()
get the implicit target
LocatorgetLocator()
access the locator
StringgetPrefixMapping(String prefix)
prefix to namespace uri mapping
ProjectgetProject()
find out the project to which this antxml context belongs
VectorgetTargets()
access the vector of targets
VectorgetWrapperStack()
access the stack of wrappers
booleanisIgnoringProjectTag()
tells whether the project tag is being ignored
RuntimeConfigurableparentWrapper()
get the runtime configurable wrapper of the parent project can return null
voidpopWrapper()
remove a runtime configurable wrapper from the stack
voidpushWrapper(RuntimeConfigurable wrapper)
add a runtime configurable wrapper to the internal stack
voidsetBuildFile(File buildFile)
sets the build file to which the XML context belongs
voidsetBuildFile(URL buildFile)
sets the build file to which the XML context belongs
voidsetCurrentProjectName(String name)
set the name of the current project
voidsetCurrentTarget(Target target)
sets the current target
voidsetCurrentTargets(Map currentTargets)
Set the map of the targets in the current source file.
voidsetIgnoreProjectTag(boolean flag)
sets the flag to ignore the project tag
voidsetImplicitTarget(Target target)
sets the implicit target
voidsetLocator(Locator locator)
sets the locator
voidstartPrefixMapping(String prefix, String uri)
Called during parsing, stores the prefix to uri mapping.

Constructor Detail

AntXMLContext

public AntXMLContext(Project project)
constructor

Parameters: project the project to which this antxml context belongs to

Method Detail

addTarget

public void addTarget(Target target)
add a new target

Parameters: target target to add

configureId

public void configureId(Object element, 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.

Parameters: element the current element attr attributes of the current element

currentWrapper

public RuntimeConfigurable currentWrapper()
get the current runtime configurable wrapper can return null

Returns: runtime configurable wrapper

endPrefixMapping

public void endPrefixMapping(String prefix)
End of prefix to uri mapping.

Parameters: prefix the namespace prefix

getBuildFile

public File getBuildFile()
find out the build file

Returns: the build file to which the xml context belongs

getBuildFileParent

public File getBuildFileParent()
find out the parent build file of this build file

Returns: the parent build file of this build file

getBuildFileParentURL

public 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

getBuildFileURL

public URL getBuildFileURL()
find out the build file

Returns: the build file to which the xml context belongs

Since: Ant 1.8.0

getCurrentProjectName

public String getCurrentProjectName()
find out the current project name

Returns: current project name

getCurrentTarget

public Target getCurrentTarget()
get the current target

Returns: current target

getCurrentTargets

public Map getCurrentTargets()
Get the targets in the current source file.

Returns: the current targets.

getImplicitTarget

public Target getImplicitTarget()
get the implicit target

Returns: implicit target

getLocator

public Locator getLocator()
access the locator

Returns: locator

getPrefixMapping

public String getPrefixMapping(String prefix)
prefix to namespace uri mapping

Parameters: prefix the prefix to map

Returns: the uri for this prefix, null if not present

getProject

public Project getProject()
find out the project to which this antxml context belongs

Returns: project

getTargets

public Vector getTargets()
access the vector of targets

Returns: vector of targets

getWrapperStack

public Vector getWrapperStack()
access the stack of wrappers

Returns: the stack of wrappers

isIgnoringProjectTag

public boolean isIgnoringProjectTag()
tells whether the project tag is being ignored

Returns: whether the project tag is being ignored

parentWrapper

public RuntimeConfigurable parentWrapper()
get the runtime configurable wrapper of the parent project can return null

Returns: runtime configurable wrapper of the parent project

popWrapper

public void popWrapper()
remove a runtime configurable wrapper from the stack

pushWrapper

public void pushWrapper(RuntimeConfigurable wrapper)
add a runtime configurable wrapper to the internal stack

Parameters: wrapper runtime configurable wrapper

setBuildFile

public void setBuildFile(File buildFile)
sets the build file to which the XML context belongs

Parameters: buildFile ant build file

setBuildFile

public void setBuildFile(URL buildFile)
sets the build file to which the XML context belongs

Parameters: buildFile ant build file

Since: Ant 1.8.0

setCurrentProjectName

public void setCurrentProjectName(String name)
set the name of the current project

Parameters: name name of the current project

setCurrentTarget

public void setCurrentTarget(Target target)
sets the current target

Parameters: target current target

setCurrentTargets

public void setCurrentTargets(Map currentTargets)
Set the map of the targets in the current source file.

Parameters: currentTargets a map of targets.

setIgnoreProjectTag

public void setIgnoreProjectTag(boolean flag)
sets the flag to ignore the project tag

Parameters: flag to ignore the project tag

setImplicitTarget

public void setImplicitTarget(Target target)
sets the implicit target

Parameters: target the implicit target

setLocator

public void setLocator(Locator locator)
sets the locator

Parameters: locator locator

startPrefixMapping

public void startPrefixMapping(String prefix, String uri)
Called during parsing, stores the prefix to uri mapping.

Parameters: prefix a namespace prefix uri a namespace uri