public class AntXMLContext
extends java.lang.Object
Constructor and Description |
---|
AntXMLContext(Project project)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addTarget(Target target)
add a new target
|
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. |
RuntimeConfigurable |
currentWrapper()
get the current runtime configurable wrapper
can return null
|
void |
endPrefixMapping(java.lang.String prefix)
End of prefix to uri mapping.
|
java.io.File |
getBuildFile()
find out the build file
|
java.io.File |
getBuildFileParent()
find out the parent build file of this build file
|
java.net.URL |
getBuildFileParentURL()
find out the parent build file of this build file
|
java.net.URL |
getBuildFileURL()
find out the build file
|
java.lang.String |
getCurrentProjectName()
find out the current project name
|
Target |
getCurrentTarget()
get the current target
|
java.util.Map |
getCurrentTargets()
Get the targets in the current source file.
|
Target |
getImplicitTarget()
get the implicit target
|
org.xml.sax.Locator |
getLocator()
access the locator
|
java.lang.String |
getPrefixMapping(java.lang.String prefix)
prefix to namespace uri mapping
|
Project |
getProject()
find out the project to which this antxml context belongs
|
java.util.Vector |
getTargets()
access the vector of targets
|
java.util.Vector |
getWrapperStack()
access the stack of wrappers
|
boolean |
isIgnoringProjectTag()
tells whether the project tag is being ignored
|
RuntimeConfigurable |
parentWrapper()
get the runtime configurable wrapper of the parent project
can return null
|
void |
popWrapper()
remove a runtime configurable wrapper from the stack
|
void |
pushWrapper(RuntimeConfigurable wrapper)
add a runtime configurable wrapper to the internal stack
|
void |
setBuildFile(java.io.File buildFile)
sets the build file to which the XML context belongs
|
void |
setBuildFile(java.net.URL buildFile)
sets the build file to which the XML context belongs
|
void |
setCurrentProjectName(java.lang.String name)
set the name of the current project
|
void |
setCurrentTarget(Target target)
sets the current target
|
void |
setCurrentTargets(java.util.Map currentTargets)
Set the map of the targets in the current source file.
|
void |
setIgnoreProjectTag(boolean flag)
sets the flag to ignore the project tag
|
void |
setImplicitTarget(Target target)
sets the implicit target
|
void |
setLocator(org.xml.sax.Locator locator)
sets the locator
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
Called during parsing, stores the prefix to uri mapping.
|
public AntXMLContext(Project project)
project
- the project to which this antxml context belongs topublic void setBuildFile(java.io.File buildFile)
buildFile
- ant build filepublic void setBuildFile(java.net.URL buildFile) throws java.net.MalformedURLException
buildFile
- ant build filejava.net.MalformedURLException
public java.io.File getBuildFile()
public java.io.File getBuildFileParent()
public java.net.URL getBuildFileURL()
public java.net.URL getBuildFileParentURL()
public Project getProject()
public java.lang.String getCurrentProjectName()
public void setCurrentProjectName(java.lang.String name)
name
- name of the current projectpublic RuntimeConfigurable currentWrapper()
public RuntimeConfigurable parentWrapper()
public void pushWrapper(RuntimeConfigurable wrapper)
wrapper
- runtime configurable wrapperpublic void popWrapper()
public java.util.Vector getWrapperStack()
public void addTarget(Target target)
target
- target to addpublic Target getCurrentTarget()
public Target getImplicitTarget()
public void setCurrentTarget(Target target)
target
- current targetpublic void setImplicitTarget(Target target)
target
- the implicit targetpublic java.util.Vector getTargets()
public void configureId(java.lang.Object element, org.xml.sax.Attributes attr)
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.
element
- the current elementattr
- attributes of the current elementpublic org.xml.sax.Locator getLocator()
public void setLocator(org.xml.sax.Locator locator)
locator
- locatorpublic boolean isIgnoringProjectTag()
public void setIgnoreProjectTag(boolean flag)
flag
- to ignore the project tagpublic void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
prefix
- a namespace prefixuri
- a namespace uripublic void endPrefixMapping(java.lang.String prefix)
prefix
- the namespace prefixpublic java.lang.String getPrefixMapping(java.lang.String prefix)
prefix
- the prefix to mappublic java.util.Map getCurrentTargets()
public void setCurrentTargets(java.util.Map currentTargets)
currentTargets
- a map of targets.