public class RuntimeConfigurable extends Object implements Serializable
Constructor and Description |
---|
RuntimeConfigurable(Object proxy,
String elementTag)
Sole constructor creating a wrapper for the specified object.
|
Modifier and Type | Method and Description |
---|---|
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(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.
|
Hashtable<String,Object> |
getAttributeMap()
Return the attribute map.
|
Enumeration<RuntimeConfigurable> |
getChildren()
Returns an enumeration of all child wrappers.
|
String |
getElementTag()
Returns the tag name of the wrapped element.
|
String |
getId()
Returns the id for this element.
|
String |
getPolyType()
Get the polymorphic type for this element.
|
Object |
getProxy()
Get the object for which this RuntimeConfigurable holds the configuration
information.
|
StringBuffer |
getText()
Get the text content of this element.
|
boolean |
isEnabled(UnknownElement owner)
Check if an UE is enabled.
|
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(String name)
Delete an attribute.
|
void |
setAttribute(String name,
Object value)
Set an attribute to a given value.
|
void |
setAttribute(String name,
String value)
Set an attribute to a given value.
|
void |
setElementTag(String elementTag)
Set the element tag.
|
void |
setPolyType(String polyType)
Set the polymorphic type for this element.
|
void |
setProxy(Object proxy)
Sets the element to configure.
|
public void addChild(RuntimeConfigurable child)
child
- The child element wrapper to add to this one.
Must 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 void addText(String data)
data
- Text to add to the wrapped element.
Should not be null
.public void applyPreSet(RuntimeConfigurable r)
r
- a RuntimeConfigurable
value.public Hashtable<String,Object> getAttributeMap()
public Enumeration<RuntimeConfigurable> getChildren()
public String getElementTag()
null
, but may be.public String getId()
public String getPolyType()
public Object getProxy()
public StringBuffer getText()
public boolean isEnabled(UnknownElement owner)
owner
- the UE that owns this RC.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 removeAttribute(String name)
name
- the name of the attribute to be removed.public void setAttribute(String name, Object value)
name
- the name of the attribute.value
- the attribute's value.public void setAttribute(String name, String value)
name
- the name of the attribute.value
- the attribute's value.public void setElementTag(String elementTag)
elementTag
- The tag name generating this element.public void setPolyType(String polyType)
polyType
- the ant component type name, null if not set.public void setProxy(Object proxy)
proxy
- The element to configure. Must not be null
.