railo.runtime.text.xml.struct
Class XMLNodeStruct

java.lang.Object
  extended by railo.runtime.type.util.StructSupport
      extended by railo.runtime.text.xml.struct.XMLNodeStruct
All Implemented Interfaces:
Serializable, Cloneable, Map, Node, Dumpable, Castable, XMLObject, XMLStruct, Collection, Iteratorable, Sizeable, Struct
Direct Known Subclasses:
XMLAttrStruct, XMLCDATASectionStruct, XMLDocumentStruct, XMLElementStruct, XMLTextStruct

public class XMLNodeStruct
extends StructSupport
implements XMLStruct

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface railo.runtime.type.Collection
Collection.Key
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from interface railo.runtime.type.Struct
TYPE_LINKED, TYPE_REGULAR, TYPE_SYNC, TYPE_WEAKED
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Method Summary
 Node appendChild(Node newChild)
           
 Boolean castToBoolean(Boolean defaultValue)
          cast the castable value to a boolean value
 boolean castToBooleanValue()
          cast the castable value to a boolean value
 DateTime castToDateTime()
          cast the castable value to a date time object
 DateTime castToDateTime(DateTime defaultValue)
          cast the castable value to a date time object
 double castToDoubleValue()
          cast the castable value to a double value
 double castToDoubleValue(double defaultValue)
          cast the castable value to a double value
 String castToString()
          cast the castable value to a string, other than the Method toString, this Method can throw a Exception
 String castToString(String defaultValue)
          cast the castable value to a string, return the default value, when the method is not castable
 void clear()
          clears the collection
 Node cloneNode(boolean deep)
           
 short compareDocumentPosition(Node other)
           
 int compareTo(boolean b)
           
 int compareTo(DateTime dt)
           
 int compareTo(double d)
           
 int compareTo(String str)
           
 boolean containsKey(Collection.Key key)
          contains this key
 Collection duplicate(boolean deepCopy)
           
 boolean equals(Object obj)
           
 Object get(Collection.Key key)
          return a value from the collection
 Object get(Collection.Key key, Object defaultValue)
          return a value from the collection, if key doesn't exist, dont throw a exception, reeturns null
 NamedNodeMap getAttributes()
           
 String getBaseURI()
           
 boolean getCaseSensitive()
           
 NodeList getChildNodes()
           
 Object getFeature(String feature, String version)
           
 Node getFirstChild()
           
 Node getLastChild()
           
 String getLocalName()
           
 Map getMap()
           
 String getNamespaceURI()
           
 Node getNextSibling()
           
 String getNodeName()
           
 short getNodeType()
           
 String getNodeValue()
           
 Document getOwnerDocument()
           
 Node getParentNode()
           
 String getPrefix()
           
 Node getPreviousSibling()
           
 String getTextContent()
           
 Object getUserData(String key)
           
 XMLNodeList getXMLNodeList()
           
 boolean hasAttributes()
           
 boolean hasChildNodes()
           
 Node insertBefore(Node newChild, Node refChild)
           
 boolean isCaseSensitive()
           
 boolean isDefaultNamespace(String namespaceURI)
           
 boolean isEqualNode(Node node)
           
 boolean isSameNode(Node other)
           
 boolean isSupported(String feature, String version)
           
 Iterator keyIterator()
           
 Collection.Key[] keys()
           
 String[] keysAsString()
           
 String lookupNamespaceURI(String prefix)
           
 String lookupPrefix(String namespaceURI)
           
 void normalize()
           
 Object remove(Collection.Key key)
          removes value from collection and return it when it exists, otherwise throws a exception
 Object remove(String key)
           
 Node removeChild(Node oldChild)
           
 Object removeEL(Collection.Key key)
          removes value from collection and return it when it exists, otherwise returns null
 Node replaceChild(Node newChild, Node oldChild)
           
 Object set(Collection.Key key, Object value)
          sets a value to the collection
 Object setEL(Collection.Key key, Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
 void setNodeValue(String nodeValue)
           
 void setPrefix(String prefix)
           
 void setTextContent(String textContent)
           
 Object setUserData(String key, Object data, UserDataHandler handler)
           
 int size()
           
 DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp)
          method to print out information to a object as HTML
 Node toNode()
           
 
Methods inherited from class railo.runtime.type.util.StructSupport
clone, containsKey, containsKey, containsValue, entrySet, get, get, get, invalidKey, isEmpty, iterator, keySet, put, putAll, remove, set, setEL, sizeOf, toString, valueIterator, values
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface railo.runtime.type.Collection
clone, containsKey, get, get, set, setEL
 
Methods inherited from interface railo.runtime.type.Iteratorable
iterator, valueIterator
 
Methods inherited from interface java.util.Map
containsKey, containsValue, entrySet, get, hashCode, isEmpty, keySet, put, putAll, remove, values
 

Method Detail

remove

public Object remove(String key)
              throws PageException
Throws:
PageException
See Also:
railo.runtime.type.Collection#remove(java.lang.String)

remove

public Object remove(Collection.Key key)
              throws PageException
Description copied from interface: Collection
removes value from collection and return it when it exists, otherwise throws a exception

Specified by:
remove in interface Collection
Parameters:
key - key of the collection
Returns:
removed Object
Throws:
PageException
See Also:
Collection.remove(railo.runtime.type.Collection.Key)

removeEL

public Object removeEL(Collection.Key key)
Description copied from interface: Collection
removes value from collection and return it when it exists, otherwise returns null

Specified by:
removeEL in interface Collection
Parameters:
key - key of the collection
Returns:
removed Object
See Also:
Collection.removeEL(railo.runtime.type.Collection.Key)

get

public Object get(Collection.Key key)
           throws PageException
Description copied from interface: Collection
return a value from the collection

Specified by:
get in interface Collection
Parameters:
key - key of the value to get must be lower case
Returns:
value on key position
Throws:
PageException
See Also:
Collection.get(railo.runtime.type.Collection.Key)

set

public Object set(Collection.Key key,
                  Object value)
           throws PageException
Description copied from interface: Collection
sets a value to the collection

Specified by:
set in interface Collection
Parameters:
key - key of the new value
value - value to set
Returns:
value setted
Throws:
PageException
See Also:
Collection.set(railo.runtime.type.Collection.Key, java.lang.Object)

getMap

public Map getMap()
Returns:
retun the inner map

duplicate

public Collection duplicate(boolean deepCopy)
Specified by:
duplicate in interface Collection
See Also:
Collection.duplicate(boolean)

cloneNode

public Node cloneNode(boolean deep)
Specified by:
cloneNode in interface Node
See Also:
Node.cloneNode(boolean)

getNodeType

public short getNodeType()
Specified by:
getNodeType in interface Node
See Also:
Node.getNodeType()

normalize

public void normalize()
Specified by:
normalize in interface Node
See Also:
Node.normalize()

hasAttributes

public boolean hasAttributes()
Specified by:
hasAttributes in interface Node
See Also:
Node.hasAttributes()

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface Node
See Also:
Node.hasChildNodes()

getLocalName

public String getLocalName()
Specified by:
getLocalName in interface Node
See Also:
Node.getLocalName()

getNamespaceURI

public String getNamespaceURI()
Specified by:
getNamespaceURI in interface Node
See Also:
Node.getNamespaceURI()

getNodeName

public String getNodeName()
Specified by:
getNodeName in interface Node
See Also:
Node.getNodeName()

getNodeValue

public String getNodeValue()
                    throws DOMException
Specified by:
getNodeValue in interface Node
Throws:
DOMException
See Also:
Node.getNodeValue()

getPrefix

public String getPrefix()
Specified by:
getPrefix in interface Node
See Also:
Node.getPrefix()

setNodeValue

public void setNodeValue(String nodeValue)
                  throws DOMException
Specified by:
setNodeValue in interface Node
Throws:
DOMException
See Also:
Node.setNodeValue(java.lang.String)

setPrefix

public void setPrefix(String prefix)
               throws DOMException
Specified by:
setPrefix in interface Node
Throws:
DOMException
See Also:
Node.setPrefix(java.lang.String)

getOwnerDocument

public Document getOwnerDocument()
Specified by:
getOwnerDocument in interface Node
See Also:
Node.getOwnerDocument()

getAttributes

public NamedNodeMap getAttributes()
Specified by:
getAttributes in interface Node
See Also:
Node.getAttributes()

getFirstChild

public Node getFirstChild()
Specified by:
getFirstChild in interface Node
See Also:
Node.getFirstChild()

getLastChild

public Node getLastChild()
Specified by:
getLastChild in interface Node
See Also:
Node.getLastChild()

getNextSibling

public Node getNextSibling()
Specified by:
getNextSibling in interface Node
See Also:
Node.getNextSibling()

getParentNode

public Node getParentNode()
Specified by:
getParentNode in interface Node
See Also:
Node.getParentNode()

getPreviousSibling

public Node getPreviousSibling()
Specified by:
getPreviousSibling in interface Node
See Also:
Node.getPreviousSibling()

getChildNodes

public NodeList getChildNodes()
Specified by:
getChildNodes in interface Node
See Also:
Node.getChildNodes()

isSupported

public boolean isSupported(String feature,
                           String version)
Specified by:
isSupported in interface Node
See Also:
Node.isSupported(java.lang.String, java.lang.String)

appendChild

public Node appendChild(Node newChild)
                 throws DOMException
Specified by:
appendChild in interface Node
Throws:
DOMException
See Also:
Node.appendChild(org.w3c.dom.Node)

removeChild

public Node removeChild(Node oldChild)
                 throws DOMException
Specified by:
removeChild in interface Node
Throws:
DOMException
See Also:
Node.removeChild(org.w3c.dom.Node)

insertBefore

public Node insertBefore(Node newChild,
                         Node refChild)
                  throws DOMException
Specified by:
insertBefore in interface Node
Throws:
DOMException
See Also:
Node.insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)

replaceChild

public Node replaceChild(Node newChild,
                         Node oldChild)
                  throws DOMException
Specified by:
replaceChild in interface Node
Throws:
DOMException
See Also:
Node.replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)

size

public int size()
Specified by:
size in interface Map
Specified by:
size in interface Collection
Returns:
the size of the collection
See Also:
Collection.size()

keysAsString

public String[] keysAsString()
Specified by:
keysAsString in interface Collection
Returns:
returns a string array of all keys in the collection

keys

public Collection.Key[] keys()
Specified by:
keys in interface Collection
Returns:
returns a string array of all keys in the collection

clear

public void clear()
Description copied from interface: Collection
clears the collection

Specified by:
clear in interface Map
Specified by:
clear in interface Collection
See Also:
Collection.clear()

get

public Object get(Collection.Key key,
                  Object defaultValue)
Description copied from interface: Collection
return a value from the collection, if key doesn't exist, dont throw a exception, reeturns null

Specified by:
get in interface Collection
Parameters:
key - key of the value to get
Returns:
value on key position or null
See Also:
Collection.get(railo.runtime.type.Collection.Key, java.lang.Object)

setEL

public Object setEL(Collection.Key key,
                    Object value)
Description copied from interface: Collection
sets a value to the collection, if key doesn't exist, dont throw a exception, returns null

Specified by:
setEL in interface Collection
Parameters:
key - key of the value to get
value - value to set
Returns:
value on key position or null
See Also:
Collection.setEL(railo.runtime.type.Collection.Key, java.lang.Object)

keyIterator

public Iterator keyIterator()
Specified by:
keyIterator in interface Iteratorable
Returns:
return a Iterator for Keys as String
See Also:
Iteratorable.keyIterator()

toDumpData

public DumpData toDumpData(PageContext pageContext,
                           int maxlevel,
                           DumpProperties dp)
Description copied from interface: Dumpable
method to print out information to a object as HTML

Specified by:
toDumpData in interface Dumpable
Overrides:
toDumpData in class StructSupport
Returns:
HTML print out
See Also:
railo.runtime.dump.Dumpable#toDumpData(railo.runtime.PageContext, int)

toNode

public final Node toNode()
Specified by:
toNode in interface XMLStruct
Returns:
casts XML Struct to a XML Node
See Also:
XMLStruct.toNode()

getCaseSensitive

public boolean getCaseSensitive()
Specified by:
getCaseSensitive in interface XMLObject
Returns:
Returns the caseSensitive.

containsKey

public boolean containsKey(Collection.Key key)
Description copied from interface: Collection
contains this key

Specified by:
containsKey in interface Collection
Returns:
returns if collection has a key with given name
See Also:
Collection.containsKey(railo.runtime.type.Collection.Key)

getXMLNodeList

public XMLNodeList getXMLNodeList()
Specified by:
getXMLNodeList in interface XMLStruct
Returns:
returns the children of the Node
See Also:
XMLStruct.getXMLNodeList()

castToString

public String castToString()
                    throws PageException
Description copied from interface: Castable
cast the castable value to a string, other than the Method toString, this Method can throw a Exception

Specified by:
castToString in interface Castable
Overrides:
castToString in class StructSupport
Returns:
String representation of the Object
Throws:
PageException
See Also:
Castable.castToString()

castToString

public String castToString(String defaultValue)
Description copied from interface: Castable
cast the castable value to a string, return the default value, when the method is not castable

Specified by:
castToString in interface Castable
Overrides:
castToString in class StructSupport
Returns:
String representation of the Object
See Also:
StructSupport.castToString(java.lang.String)

castToBooleanValue

public boolean castToBooleanValue()
                           throws ExpressionException
Description copied from interface: Castable
cast the castable value to a boolean value

Specified by:
castToBooleanValue in interface Castable
Overrides:
castToBooleanValue in class StructSupport
Returns:
boolean Value representation of the Object
Throws:
ExpressionException
See Also:
Castable.castToBooleanValue()

castToBoolean

public Boolean castToBoolean(Boolean defaultValue)
Description copied from interface: Castable
cast the castable value to a boolean value

Specified by:
castToBoolean in interface Castable
Overrides:
castToBoolean in class StructSupport
Returns:
boolean Value representation of the Object
See Also:
Castable.castToBoolean(java.lang.Boolean)

castToDoubleValue

public double castToDoubleValue()
                         throws ExpressionException
Description copied from interface: Castable
cast the castable value to a double value

Specified by:
castToDoubleValue in interface Castable
Overrides:
castToDoubleValue in class StructSupport
Returns:
double Value representation of the Object
Throws:
ExpressionException
See Also:
Castable.castToDoubleValue()

castToDoubleValue

public double castToDoubleValue(double defaultValue)
Description copied from interface: Castable
cast the castable value to a double value

Specified by:
castToDoubleValue in interface Castable
Overrides:
castToDoubleValue in class StructSupport
Returns:
double Value representation of the Object
See Also:
Castable.castToDoubleValue(double)

castToDateTime

public DateTime castToDateTime()
                        throws ExpressionException
Description copied from interface: Castable
cast the castable value to a date time object

Specified by:
castToDateTime in interface Castable
Overrides:
castToDateTime in class StructSupport
Returns:
date time representation of the Object
Throws:
ExpressionException
See Also:
Castable.castToDateTime()

castToDateTime

public DateTime castToDateTime(DateTime defaultValue)
Description copied from interface: Castable
cast the castable value to a date time object

Specified by:
castToDateTime in interface Castable
Overrides:
castToDateTime in class StructSupport
Parameters:
defaultValue - returned when it is not possible to cast to a dateTime object
Returns:
date time representation of the Object
See Also:
Castable.castToDateTime(railo.runtime.type.dt.DateTime)

compareTo

public int compareTo(boolean b)
              throws PageException
Specified by:
compareTo in interface Castable
Overrides:
compareTo in class StructSupport
Throws:
PageException
See Also:
railo.runtime.op.Castable#compare(boolean)

compareTo

public int compareTo(DateTime dt)
              throws PageException
Specified by:
compareTo in interface Castable
Overrides:
compareTo in class StructSupport
Throws:
PageException
See Also:
Castable.compareTo(railo.runtime.type.dt.DateTime)

compareTo

public int compareTo(double d)
              throws PageException
Specified by:
compareTo in interface Castable
Overrides:
compareTo in class StructSupport
Throws:
PageException
See Also:
Castable.compareTo(double)

compareTo

public int compareTo(String str)
              throws PageException
Specified by:
compareTo in interface Castable
Overrides:
compareTo in class StructSupport
Throws:
PageException
See Also:
Castable.compareTo(java.lang.String)

getBaseURI

public String getBaseURI()
Specified by:
getBaseURI in interface Node
See Also:
Node.getBaseURI()

compareDocumentPosition

public short compareDocumentPosition(Node other)
                              throws DOMException
Specified by:
compareDocumentPosition in interface Node
Throws:
DOMException
See Also:
Node.compareDocumentPosition(org.w3c.dom.Node)

setTextContent

public void setTextContent(String textContent)
                    throws DOMException
Specified by:
setTextContent in interface Node
Throws:
DOMException
See Also:
Node.setTextContent(java.lang.String)

isSameNode

public boolean isSameNode(Node other)
Specified by:
isSameNode in interface Node
See Also:
Node.isSameNode(org.w3c.dom.Node)

lookupPrefix

public String lookupPrefix(String namespaceURI)
Specified by:
lookupPrefix in interface Node
See Also:
Node.lookupPrefix(java.lang.String)

isDefaultNamespace

public boolean isDefaultNamespace(String namespaceURI)
Specified by:
isDefaultNamespace in interface Node
See Also:
Node.isDefaultNamespace(java.lang.String)

lookupNamespaceURI

public String lookupNamespaceURI(String prefix)
Specified by:
lookupNamespaceURI in interface Node
See Also:
Node.lookupNamespaceURI(java.lang.String)

isEqualNode

public boolean isEqualNode(Node node)
Specified by:
isEqualNode in interface Node
See Also:
Node.isEqualNode(org.w3c.dom.Node)

getFeature

public Object getFeature(String feature,
                         String version)
Specified by:
getFeature in interface Node
See Also:
Node.getFeature(java.lang.String, java.lang.String)

getUserData

public Object getUserData(String key)
Specified by:
getUserData in interface Node
See Also:
Node.getUserData(java.lang.String)

getTextContent

public String getTextContent()
                      throws DOMException
Specified by:
getTextContent in interface Node
Throws:
DOMException
See Also:
Node.getTextContent()

setUserData

public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler)
Specified by:
setUserData in interface Node
See Also:
Node.setUserData(java.lang.String, java.lang.Object, org.w3c.dom.UserDataHandler)

isCaseSensitive

public boolean isCaseSensitive()
Specified by:
isCaseSensitive in interface XMLStruct

equals

public boolean equals(Object obj)
Specified by:
equals in interface Map
Overrides:
equals in class StructSupport


Copyright © 2012 Railo