|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.RuntimeConfigurable
public class RuntimeConfigurable
Wrapper class that holds the attributes of an element, its children, and any text within it. It then takes care of configuring that element at runtime.
Constructor Summary | |
---|---|
RuntimeConfigurable(java.lang.Object proxy,
java.lang.String elementTag)
Sole constructor creating a wrapper for the specified object. |
Method Summary | |
---|---|
void |
addChild(RuntimeConfigurable child)
Adds a child element to the wrapped element. |
void |
addText(char[] buf,
int start,
int count)
Adds characters from #PCDATA areas to the wrapped element. |
void |
addText(java.lang.String data)
Adds characters from #PCDATA areas to the wrapped element. |
void |
applyPreSet(RuntimeConfigurable r)
Apply presets, attributes and text are set if not currently set. |
java.util.Hashtable |
getAttributeMap()
Return the attribute map. |
org.xml.sax.AttributeList |
getAttributes()
Deprecated. Deprecated since Ant 1.6 in favor of getAttributeMap() . |
java.util.Enumeration |
getChildren()
Returns an enumeration of all child wrappers. |
java.lang.String |
getElementTag()
Returns the tag name of the wrapped element. |
java.lang.String |
getId()
Returns the id for this element. |
java.lang.String |
getPolyType()
Get the polymorphic type for this element. |
java.lang.Object |
getProxy()
Get the object for which this RuntimeConfigurable holds the configuration information. |
java.lang.StringBuffer |
getText()
Get the text content of this element. |
void |
maybeConfigure(Project p)
Configures the wrapped element and all its children. |
void |
maybeConfigure(Project p,
boolean configureChildren)
Configures the wrapped element. |
void |
reconfigure(Project p)
Reconfigure the element, even if it has already been configured. |
void |
removeAttribute(java.lang.String name)
Delete an attribute. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Set an attribute to a given value. |
void |
setAttributes(org.xml.sax.AttributeList attributes)
Deprecated. since 1.6.x. |
void |
setElementTag(java.lang.String elementTag)
Set the element tag. |
void |
setPolyType(java.lang.String polyType)
Set the polymorphic type for this element. |
void |
setProxy(java.lang.Object proxy)
Sets the element to configure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RuntimeConfigurable(java.lang.Object proxy, java.lang.String elementTag)
proxy
- The element to configure. Must not be null
.elementTag
- The tag name generating this element.Method Detail |
---|
public void setProxy(java.lang.Object proxy)
proxy
- The element to configure. Must not be null
.public java.lang.Object getProxy()
public java.lang.String getId()
public java.lang.String getPolyType()
public void setPolyType(java.lang.String polyType)
polyType
- the ant component type name, null if not set.public void setAttributes(org.xml.sax.AttributeList attributes)
attributes
- List of attributes defined in the XML for this
element. May be null
.public void setAttribute(java.lang.String name, java.lang.String value)
name
- the name of the attribute.value
- the attribute's value.public void removeAttribute(java.lang.String name)
name
- the name of the attribute to be removed.public java.util.Hashtable getAttributeMap()
public org.xml.sax.AttributeList getAttributes()
getAttributeMap()
.
null
.public void addChild(RuntimeConfigurable child)
child
- The child element wrapper to add to this one.
Must not be null
.public java.util.Enumeration getChildren()
public void addText(java.lang.String data)
data
- Text to add to the wrapped element.
Should not be null
.public void addText(char[] buf, int start, int count)
buf
- A character array of the text within the element.
Must not be null
.start
- The start element in the array.count
- The number of characters to read from the array.public java.lang.StringBuffer getText()
public void setElementTag(java.lang.String elementTag)
elementTag
- The tag name generating this element.public java.lang.String getElementTag()
null
, but may be.public void maybeConfigure(Project p) throws BuildException
id
attribute, a reference
is added to the project as well.
p
- The project containing the wrapped element.
Must not be null
.
BuildException
- if the configuration fails, for instance due
to invalid attributes or children, or text being added to
an element which doesn't accept it.public void maybeConfigure(Project p, boolean configureChildren) throws BuildException
id
attribute, a reference
is added to the project as well.
p
- The project containing the wrapped element.
Must not be null
.configureChildren
- ignored.
BuildException
- if the configuration fails, for instance due
to invalid attributes , or text being added to
an element which doesn't accept it.public void reconfigure(Project p)
p
- the project instance for this configuration.public void applyPreSet(RuntimeConfigurable r)
r
- a RuntimeConfigurable
value.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |