|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.specrunner.util.xom.node.core.NodeHolderDefault
public class NodeHolderDefault
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.expression.IAbstraction |
|---|
DEFAULT_EVAL_ARGS, FEATURE_EVAL_ARGS |
| Constructor Summary | |
|---|---|
NodeHolderDefault(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. |
protected List<Object> |
getArgumentsLocal(IContext context,
boolean silent,
List<String> arguments)
Get arguments for evaluation. |
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. |
IFormatter |
getFormatter()
Get the abstraction formatter. |
IFormatter |
getFormatter(IFormatter formatterDefault)
Get the abstraction formatter. |
List<String> |
getFormatterArguments()
Get formatter attributes. |
List<String> |
getFormatterArguments(List<String> arguments)
Get formatter arguments. |
protected Object |
getLocal(IContext context,
boolean silent,
IConverter converter,
List<String> arguments)
|
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. |
protected Object |
getProperty(IContext context,
boolean silent)
Get property value. |
String |
getQualifiedName()
Get qualified name (include namespace). |
IReader |
getReader()
Get reader object. |
IReader |
getReader(IReader readerDefault)
Get reader object or default if not found. |
String |
getValue(IContext context)
Get element value. |
protected Object |
getValue(IContext context,
boolean silent)
Get value. |
String |
getValue(IContext context,
Object[] args)
Get element value. |
boolean |
hasAttribute(String name)
Check if an given attribute is present. |
boolean |
hasName(String name)
Check a tag name. |
protected boolean |
isProperty()
Is property value set. |
protected boolean |
notEval()
Is evaluation turned off. |
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 NodeHolderDefault(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(IContext context)
IAbstraction
getValue in interface IAbstractioncontext - The test context.
public String getValue(IContext context,
Object[] args)
IAbstraction
getValue in interface IAbstractioncontext - The test context.args - Arguments to return value.
public 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 IReader getReader()
IAbstraction
getReader in interface IAbstractionpublic IReader getReader(IReader readerDefault)
IAbstraction
getReader in interface IAbstractionreaderDefault - The default reader.
public IConverter getConverter()
IAbstraction
getConverter in interface IAbstractionpublic IConverter getConverter(IConverter converterDefault)
IAbstraction
getConverter in interface IAbstractionconverterDefault - The default converter.
public List<String> getArguments()
IAbstraction
getArguments in interface IAbstractionpublic List<String> getArguments(List<String> arguments)
IAbstraction
getArguments in interface IAbstractionarguments - The default arguments in case of not found.
public IComparator getComparator()
throws ComparatorException
IAbstraction
getComparator in interface IAbstractionComparatorException - O comparator lookup errors.
public IComparator getComparator(IComparator comparatorDefault)
throws ComparatorException
IAbstraction
getComparator in interface IAbstractioncomparatorDefault - The default comparator.
ComparatorException - O comparator lookup errors.public List<String> getFormatterArguments()
IAbstraction
getFormatterArguments in interface IAbstractionpublic List<String> getFormatterArguments(List<String> arguments)
IAbstraction
getFormatterArguments in interface IAbstractionarguments - Default list of arguments.
public IFormatter getFormatter()
throws FormatterException
IAbstraction
getFormatter in interface IAbstractionFormatterException - On formatter lookup error.
public IFormatter getFormatter(IFormatter formatterDefault)
throws FormatterException
IAbstraction
getFormatter in interface IAbstractionformatterDefault - Default formatter.
FormatterException - On formatter lookup error.
public Object getObject(IContext context,
boolean silent)
throws PluginException
IAbstraction
getObject in interface IAbstractioncontext - 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
IAbstraction
getObject in interface IAbstractioncontext - The context.silent - Flag to evaluate silently or not.converter - The converter.arguments - The arguments.
PluginException - On plugin errors.
protected Object getLocal(IContext context,
boolean silent,
IConverter converter,
List<String> arguments)
throws PluginException
PluginExceptiongetObject.protected boolean isProperty()
protected Object getProperty(IContext context,
boolean silent)
throws PluginException
context - A context.silent - Silent evaluation flag.
PluginException - On lookup errors.
protected Object getValue(IContext context,
boolean silent)
throws PluginException
context - A context.silent - Silent evaluation flag.
PluginException - On evaluation errors.protected boolean notEval()
protected List<Object> getArgumentsLocal(IContext context,
boolean silent,
List<String> arguments)
throws PluginException
context - A context.silent - Silent evaluation flag.arguments - Value arguments.
PluginException - On evaluation 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 | |||||||||