public class NodeHolderDefault extends Object implements INodeHolder
| Type | Property and Description |
|---|---|
protected boolean |
is
Is property value set.
|
| Modifier and Type | Field and Description |
|---|---|
protected String |
attributeValue
The attribute value.
|
protected nu.xom.Node |
node
The node encapsulated.
|
ATTRIBUTE_ARGUMENT_CONVERTER_PREFIX, ATTRIBUTE_ARGUMENT_FORMATTER_PREFIX, ATTRIBUTE_CEVALUATION, ATTRIBUTE_COMPARATOR, ATTRIBUTE_CONVERTER, ATTRIBUTE_EVALUATION, ATTRIBUTE_FORCE_CONTENT, ATTRIBUTE_FORCE_VALUE, ATTRIBUTE_FORMATTER, ATTRIBUTE_PROPERTY, ATTRIBUTE_READER, ATTRIBUTE_VALUEDEFAULT_EVAL_ARGS, DEFAULT_EVAL_FORMATTER_ARGS, FEATURE_EVAL_ARGS, FEATURE_EVAL_FORMATTER_ARGS| Constructor and Description |
|---|
NodeHolderDefault(nu.xom.Node element)
Create a element holder.
|
| Modifier and Type | Method and Description |
|---|---|
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(...)
calls.Default is ATTRIBUTE_VALUE. |
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 List<Object> |
getFormatterArgumentsLocal(IContext context,
boolean silent,
List<String> arguments)
Get arguments for formatter evaluation.
|
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 |
notCeval()
Is content evaluation turned off.
|
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.
|
protected nu.xom.Node node
protected String attributeValue
public NodeHolderDefault(nu.xom.Node element)
element - The element.public nu.xom.Node getNode()
INodeHoldergetNode in interface INodeHolderpublic void setNode(nu.xom.Node element)
INodeHoldersetNode in interface INodeHolderelement - The node.public void detach()
INodeHolderdetach in interface INodeHolderpublic String getAttributeValue()
INodeHoldergetObject(...)
calls.Default is ATTRIBUTE_VALUE.getAttributeValue in interface INodeHolderpublic void setAttributeValue(String attributeValue)
INodeHoldersetAttributeValue in interface INodeHolderattributeValue - A attribute name.public String getQualifiedName()
INodeHoldergetQualifiedName in interface INodeHolderpublic boolean hasName(String name)
INodeHolderhasName in interface INodeHoldername - The name.public boolean hasAttribute(String name)
INodeHolderhasAttribute in interface INodeHoldername - The attribute name.public String getAttribute(String name)
INodeHoldergetAttribute in interface INodeHoldername - The name.public String getAttribute(String name, String defaultValue)
INodeHoldergetAttribute in interface INodeHoldername - The name.defaultValue - The defaul value.public void setAttribute(String name, String value)
INodeHoldersetAttribute in interface INodeHoldername - The name.value - The value.public void removeAttribute(String name)
INodeHolderremoveAttribute in interface INodeHoldername - The attribute name.public boolean attributeContains(String name, String value)
INodeHolderattributeContains in interface INodeHoldername - The attribute name.value - The attribute value.public boolean attributeEquals(String name, String value)
INodeHolderattributeEquals in interface INodeHoldername - The attribute name.value - The attribute value.public String getValue(IContext context)
IAbstractiongetValue in interface IAbstractioncontext - The test context.public String getValue(IContext context, Object[] args)
IAbstractiongetValue in interface IAbstractioncontext - The test context.args - Arguments to return value.public void setValue(String text)
INodeHoldersetValue in interface INodeHoldertext - The expected text.public void prepend(String text)
INodeHolderprepend in interface INodeHoldertext - A text.public void prepend(nu.xom.Node child)
INodeHolderprepend in interface INodeHolderchild - A node.public void append(String text)
INodeHolderappend in interface INodeHoldertext - A text.public void append(nu.xom.Node child)
INodeHolderappend in interface INodeHolderchild - A node.public IReader getReader()
IAbstractiongetReader in interface IAbstractionpublic IReader getReader(IReader readerDefault)
IAbstractiongetReader in interface IAbstractionreaderDefault - The default reader.public IConverter getConverter()
IAbstractiongetConverter in interface IAbstractionpublic IConverter getConverter(IConverter converterDefault)
IAbstractiongetConverter in interface IAbstractionconverterDefault - The default converter.public List<String> getArguments()
IAbstractiongetArguments in interface IAbstractionpublic List<String> getArguments(List<String> arguments)
IAbstractiongetArguments in interface IAbstractionarguments - The default arguments in case of not found.public IComparator getComparator() throws ComparatorException
IAbstractiongetComparator in interface IAbstractionComparatorException - O comparator lookup errors.public IComparator getComparator(IComparator comparatorDefault) throws ComparatorException
IAbstractiongetComparator in interface IAbstractioncomparatorDefault - The default comparator.ComparatorException - O comparator lookup errors.public List<String> getFormatterArguments()
IAbstractiongetFormatterArguments in interface IAbstractionpublic List<String> getFormatterArguments(List<String> arguments)
IAbstractiongetFormatterArguments in interface IAbstractionarguments - Default list of arguments.public IFormatter getFormatter() throws FormatterException
IAbstractiongetFormatter in interface IAbstractionFormatterException - On formatter lookup error.public IFormatter getFormatter(IFormatter formatterDefault) throws FormatterException
IAbstractiongetFormatter in interface IAbstractionformatterDefault - Default formatter.FormatterException - On formatter lookup error.public Object getObject(IContext context, boolean silent) throws PluginException
IAbstractiongetObject 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
IAbstractiongetObject 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 boolean notCeval()
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.protected List<Object> getFormatterArgumentsLocal(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()
INodeHoldertoXML in interface INodeHolderCopyright © 2016. All rights reserved.