org.inria.ns.reflex.xml.operator
Class NullOperator

java.lang.Object
  extended by org.inria.ns.reflex.xml.operator.AbstractXOperator
      extended by org.inria.ns.reflex.xml.operator.DefaultXOperator
          extended by org.inria.ns.reflex.xml.operator.NullOperator
All Implemented Interfaces:
LoopOnChildren, XOperator

public class NullOperator
extends DefaultXOperator
implements LoopOnChildren

XML operations on null : do nothing, return nothing, loop on nothing...

Author:
Philippe Poulard

Method Summary
 boolean booleanValueOf(Object referent)
          This implementation returns the boolean value of the referent based on its string value.
 String getNodeKind(Object referent)
          Return "null".
 short getNodeType(Object referent)
          The referent doesn't behave like a node.
 Object getParent(Object referent)
          Return the parent of the referent object.
 QName getQName(Object referent)
          Return the qualified name of the referent object if any, or null.
 Type getType(Object referent)
          Return the type of the object.
 Object getValue(Object referent)
          Retrieve the value of the referent object, or null.
 Number numberValueOf(Object referent)
          This implementation returns the number value of the referent based on its string value.
 String stringValueOf(Object referent)
          This implementation returns the string value of the referent.
 Object valueOf(Object referent)
          Return null.
 
Methods inherited from class org.inria.ns.reflex.xml.operator.DefaultXOperator
getAttributes, getChildren, getTypeName
 
Methods inherited from class org.inria.ns.reflex.xml.operator.AbstractXOperator
append, append, clear, clear, clearAll, clearAll, clone, clone, getAttributeValue, getCommentAt, getElementAt, getElementById, getElementsByName, getFamilyIndex, getFamilySize, getIndex, getNamedElementAt, getNamedProcessingInstructionAt, getNameIndex, getNameSize, getNamespaces, getNext, getNodeAt, getPrevious, getProcessingInstructionAt, getRoot, getSize, getStringAttributeValue, getStringName, getTextAt, getTypeIndex, getTypeSize, getXFactory, getXMLType, getXOperator, insertAfter, insertAfter, insertBefore, insertBefore, isAttribute, isComment, isDocument, isElement, isParentNode, isProcessingInstruction, isText, remove, remove, removeAttribute, rename, rename, replace, replace, setAttribute, update, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getQName

public QName getQName(Object referent)
Description copied from class: AbstractXOperator
Return the qualified name of the referent object if any, or null. This default implementation returns null.

Specified by:
getQName in interface XOperator
Overrides:
getQName in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
The qualified name of the referent object.

getParent

public Object getParent(Object referent)
Description copied from class: AbstractXOperator
Return the parent of the referent object. This default implementation returns null.

The parent returned is not the structural parent of the object, but the functional parent ; for example, if a component stores its attributes in a Map, the parent of an attribute of the component is not the Map that hold the attributes but the component itself.

Specified by:
getParent in interface XOperator
Overrides:
getParent in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
The parent of the referent object.

getValue

public Object getValue(Object referent)
Description copied from class: AbstractXOperator
Retrieve the value of the referent object, or null. This default implementation returns null.

Specified by:
getValue in interface XOperator
Overrides:
getValue in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
The value of the referent object.

getType

public Type getType(Object referent)
Description copied from class: AbstractXOperator
Return the type of the object. This default implementation returns null.

Specified by:
getType in interface XOperator
Overrides:
getType in class AbstractXOperator
Parameters:
referent - The referent object.
Returns:
The type of the referent object.

getNodeKind

public String getNodeKind(Object referent)
Return "null".

Specified by:
getNodeKind in interface XOperator
Overrides:
getNodeKind in class AbstractXOperator
Parameters:
referent - =null
Returns:
"attribute", "comment", "document", "element", "namespace", "processing-instruction", "text" or ""
See Also:
XOperator.getNodeKind(java.lang.Object)

stringValueOf

public String stringValueOf(Object referent)
Description copied from class: AbstractXOperator
This implementation returns the string value of the referent.

Specified by:
stringValueOf in interface XOperator
Overrides:
stringValueOf in class AbstractXOperator
Parameters:
referent - The referent.
Returns:
Its string value.
See Also:
Object.toString()

numberValueOf

public Number numberValueOf(Object referent)
Description copied from class: AbstractXOperator
This implementation returns the number value of the referent based on its string value. May return an arbitrary-precision signed decimal number.

Specified by:
numberValueOf in interface XOperator
Overrides:
numberValueOf in class AbstractXOperator
Parameters:
referent - The referent.
Returns:
Its number value.
See Also:
AbstractXOperator.stringValueOf(Object), NumberOperator.parseNumber(String)

booleanValueOf

public boolean booleanValueOf(Object referent)
Description copied from class: AbstractXOperator
This implementation returns the boolean value of the referent based on its string value.

Specified by:
booleanValueOf in interface XOperator
Overrides:
booleanValueOf in class AbstractXOperator
Parameters:
referent - The referent.
Returns:
Its boolean value.
See Also:
AbstractXOperator.stringValueOf(Object)

valueOf

public Object valueOf(Object referent)
Return null.

Specified by:
valueOf in interface XOperator
Overrides:
valueOf in class AbstractXOperator
Parameters:
referent - The referent.
Returns:
null.

getNodeType

public short getNodeType(Object referent)
The referent doesn't behave like a node.

Specified by:
getNodeType in interface XOperator
Overrides:
getNodeType in class DefaultXOperator
Parameters:
referent - The referent object.
Returns:
This implementation returns "the not-a-node type".
See Also:
XType.NOT_A_NODE