|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.oddjob.arooa.ArooaRuntime
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.
Based on an original by Stefan Bodewig
| Constructor Summary | |
ArooaRuntime(java.lang.Object wrappedObject,
java.lang.String elementTag)
Constructor for creating a wrapper wthout a context. |
|
ArooaRuntime(java.lang.Object wrappedObject,
java.lang.String elementTag,
ArooaContext context)
Constructor for creating a wrapper for the specified object. |
|
| Method Summary | |
void |
addChild(RuntimeConfiguration child)
Adds a child element to the wrapped element. |
void |
addConfigurationListener(ConfigurationListener l)
|
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 |
configure()
Configure with preset or no properties. |
void |
configure(RegistryLookup registry,
boolean strictSubstitution)
Configures the wrapped element. |
protected void |
fireConfigurationComplete()
|
java.lang.String |
getAttribute(java.lang.String name)
Get the text for an attribute. |
java.util.Hashtable |
getAttributeMap()
Return the attribute map. |
java.util.Enumeration |
getChildren()
Returns an enumeration of all child wrappers. |
java.lang.String |
getElementTag()
Returns the tag name of the wrapped element. |
RegistryLookup |
getRegistryLookup()
|
java.lang.StringBuffer |
getText()
Get the text content of this element. |
java.lang.Object |
getWrappedObject()
Get the object for which this RuntimeConfigurable holds the configuration information |
boolean |
isLeaveProxy()
leaveProxy isn't set in the context until after this RTC is created. |
boolean |
isStrictSubstituation()
|
void |
link(RuntimeConfiguration link)
Link a to child component. |
void |
removeConfigurationListener(ConfigurationListener l)
|
void |
setAttribute(java.lang.String name,
RuntimeConfiguration rtc)
Set an attribute to a runtime configurable |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Set an attribute to a given value |
void |
setConfigured(boolean configured)
Set this runtime as configured. |
void |
setMappedProperty(java.lang.String name,
java.lang.String key,
RuntimeConfiguration rtc)
Set a mapped property. |
void |
setStrictSubstituation(boolean value)
|
java.lang.String |
toString()
|
RuntimeConfiguration |
unlink(java.lang.Object linkedComponent)
Remove a linked runtime. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ArooaRuntime(java.lang.Object wrappedObject,
java.lang.String elementTag,
ArooaContext context)
The Context is provided then the following will affect how the object is configured at runtime.
ArooaConstants.SUBSTITUTION_POLICY Optional - default is not strict.ArooaConstants.RTC_LEAVE_PROXY Optional - default is false.ArooaConstants.BEAN_UTILS_BEAN Optional - default is the
static instance.
wrappedObject - The element to configure. Must not be null.elementTag - The tag name generating this element.
Should not be null.context - A Context, may not be null.
public ArooaRuntime(java.lang.Object wrappedObject,
java.lang.String elementTag)
wrappedObject - The element to configure. Must not be null.elementTag - The tag name generating this element. Should not be
null.| Method Detail |
public java.lang.Object getWrappedObject()
getWrappedObject in interface RuntimeConfigurationpublic boolean isLeaveProxy()
public void setStrictSubstituation(boolean value)
public boolean isStrictSubstituation()
public void setConfigured(boolean configured)
configured -
public void setAttribute(java.lang.String name,
java.lang.String value)
name - the name of the attribute.value - the attribute's value.
public void setMappedProperty(java.lang.String name,
java.lang.String key,
RuntimeConfiguration rtc)
name - The name of the mapped property.key - The mapped properties key.
public void setAttribute(java.lang.String name,
RuntimeConfiguration rtc)
name - the name of the attribute.public java.lang.String getAttribute(java.lang.String name)
getAttribute in interface RuntimeConfigurationname - The attribute name.
public java.util.Hashtable getAttributeMap()
public void addChild(RuntimeConfiguration child)
addChild in interface RuntimeConfigurationchild - The child element wrapper to add to this one.
Must not be null.public java.util.Enumeration getChildren()
getChildren in interface RuntimeConfigurationpublic void link(RuntimeConfiguration link)
public RuntimeConfiguration unlink(java.lang.Object linkedComponent)
linkedComponent - The linked component.
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)
addText in interface RuntimeConfigurationbuf - 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 java.lang.String getElementTag()
getElementTag in interface RuntimeConfigurationnull, but may be.
public void configure()
throws ArooaException
configure in interface RuntimeConfigurationArooaException - If it can't be configured.
public void configure(RegistryLookup registry,
boolean strictSubstitution)
throws ArooaException
id attribute, a reference
is added to the project as well.
configure in interface RuntimeConfigurationArooaException - 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 RegistryLookup getRegistryLookup()
public void addConfigurationListener(ConfigurationListener l)
public void removeConfigurationListener(ConfigurationListener l)
protected void fireConfigurationComplete()
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||