|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.specrunner.util.xom.NodeHolder
public class NodeHolder
Default implementation of element holder.
| Field Summary | |
|---|---|
protected String |
attributeValue
The attribute value. |
protected nu.xom.Node |
node
The node encapsulated. |
| Fields inherited from interface org.specrunner.util.xom.INodeHolder |
|---|
ATTRIBUTE_ARGUMENT_PREFIX, ATTRIBUTE_COMPARATOR, ATTRIBUTE_CONVERTER, ATTRIBUTE_EVALUATION, ATTRIBUTE_PROPERTY, ATTRIBUTE_VALUE |
| Constructor Summary | |
|---|---|
NodeHolder(nu.xom.Node element)
Create a element holder. |
|
| Method Summary | |
|---|---|
void |
append(nu.xom.Node child)
Append node to the node. |
void |
append(String text)
Append text to the node. |
boolean |
attributeContains(String name,
String value)
Check if an attribute exists, and if it exists, if it contains the given value. |
boolean |
attributeEquals(String name,
String value)
Check if an attribute exists, and if it exists, if it is equal to the given value. |
void |
detach()
Detaches the current node. |
List<String> |
getArguments()
Get element arguments in a array. |
List<String> |
getArguments(List<String> arguments)
Get element arguments in a array. |
String |
getAttribute(String name)
Get attribute value by type. |
String |
getAttribute(String name,
String defaultValue)
Get attribute value by type. |
String |
getAttributeValue()
Set attribute value to look for on getObject(...) |
IComparator |
getComparator()
Get the comparator of the given element. |
IComparator |
getComparator(IComparator comparatorDefault)
Get the comparator of the given element. |
IConverter |
getConverter()
Get the converter. |
IConverter |
getConverter(IConverter converterDefault)
Get the converter, if any, otherwise returns the default converter. |
nu.xom.Node |
getNode()
Get the hold node. |
Object |
getObject(IContext context,
boolean silent)
Gets the corresponding value object. |
Object |
getObject(IContext context,
boolean silent,
IConverter converter,
List<String> arguments)
Gets the corresponding value object. |
String |
getQualifiedName()
Get qualified name (include namespace). |
String |
getValue()
Get element value. |
boolean |
hasAttribute(String name)
Check if an given attribute is present. |
boolean |
hasName(String name)
Check a tag name. |
void |
prepend(nu.xom.Node child)
Prepend a note to the node. |
void |
prepend(String text)
Prepend text to the node. |
void |
removeAttribute(String name)
Remove a attribute. |
void |
setAttribute(String name,
String value)
Set attribute value. |
void |
setAttributeValue(String attributeValue)
Set value attribute holder. |
void |
setNode(nu.xom.Node element)
Set the hold node. |
void |
setValue(String text)
Set text to a node removing all children elements. |
String |
toString()
|
String |
toXML()
The XML representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected nu.xom.Node node
protected String attributeValue
| Constructor Detail |
|---|
public NodeHolder(nu.xom.Node element)
element - The element.| Method Detail |
|---|
public nu.xom.Node getNode()
INodeHolder
getNode in interface INodeHolderpublic void setNode(nu.xom.Node element)
INodeHolder
setNode in interface INodeHolderelement - The node.public void detach()
INodeHolder
detach in interface INodeHolderpublic String getAttributeValue()
INodeHoldergetObject(...)
calls.Default is ATTRIBUTE_VALUE.
getAttributeValue in interface INodeHolderpublic void setAttributeValue(String attributeValue)
INodeHolder
setAttributeValue in interface INodeHolderattributeValue - A attribute name.public String getQualifiedName()
INodeHolder
getQualifiedName in interface INodeHolderpublic boolean hasName(String name)
INodeHolder
hasName in interface INodeHoldername - The name.
public boolean hasAttribute(String name)
INodeHolder
hasAttribute in interface INodeHoldername - The attribute name.
public String getAttribute(String name)
INodeHolder
getAttribute in interface INodeHoldername - The name.
public String getAttribute(String name,
String defaultValue)
INodeHolder
getAttribute in interface INodeHoldername - The name.defaultValue - The defaul value.
public void setAttribute(String name,
String value)
INodeHolder
setAttribute in interface INodeHoldername - The name.value - The value.public void removeAttribute(String name)
INodeHolder
removeAttribute in interface INodeHoldername - The attribute name.
public boolean attributeContains(String name,
String value)
INodeHolder
attributeContains in interface INodeHoldername - The attribute name.value - The attribute value.
public boolean attributeEquals(String name,
String value)
INodeHolder
attributeEquals in interface INodeHoldername - The attribute name.value - The attribute value.
public String getValue()
INodeHolder
getValue in interface INodeHolderpublic void setValue(String text)
INodeHolder
setValue in interface INodeHoldertext - The expected text.public void prepend(String text)
INodeHolder
prepend in interface INodeHoldertext - A text.public void prepend(nu.xom.Node child)
INodeHolder
prepend in interface INodeHolderchild - A node.public void append(String text)
INodeHolder
append in interface INodeHoldertext - A text.public void append(nu.xom.Node child)
INodeHolder
append in interface INodeHolderchild - A node.public IConverter getConverter()
INodeHolder
getConverter in interface INodeHolderpublic IConverter getConverter(IConverter converterDefault)
INodeHolder
getConverter in interface INodeHolderconverterDefault - The default converter.
public List<String> getArguments()
INodeHolder
getArguments in interface INodeHolderpublic List<String> getArguments(List<String> arguments)
INodeHolder
getArguments in interface INodeHolderarguments - The default arguments in case of not found.
public IComparator getComparator()
throws ComparatorException
INodeHolder
getComparator in interface INodeHolderComparatorException - O comparator lookup errors.
public IComparator getComparator(IComparator comparatorDefault)
throws ComparatorException
INodeHolder
getComparator in interface INodeHoldercomparatorDefault - The default comparator.
ComparatorException - O comparator lookup errors.
public Object getObject(IContext context,
boolean silent)
throws PluginException
INodeHolder
getObject in interface INodeHoldercontext - The context.silent - Flag to evaluate silently or not.
PluginException - On plugin errors.
public Object getObject(IContext context,
boolean silent,
IConverter converter,
List<String> arguments)
throws PluginException
INodeHolder
getObject in interface INodeHoldercontext - The context.silent - Flag to evaluate silently or not.converter - The converter.arguments - The arguments.
PluginException - On plugin errors.public String toXML()
INodeHolder
toXML in interface INodeHolderpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||