railo.runtime.text.xml
Class XMLNodeList

java.lang.Object
  extended by railo.runtime.type.util.ArraySupport
      extended by railo.runtime.text.xml.XMLNodeList
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, NodeList, Dumpable, Castable, XMLObject, Array, Iteratorable, Sizeable

public final class XMLNodeList
extends ArraySupport
implements NodeList, XMLObject

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface railo.runtime.type.Collection
Collection.Key
 
Field Summary
 
Fields inherited from class railo.runtime.type.util.ArraySupport
TYPE_BOOLEAN, TYPE_BYTE, TYPE_CHARACTER, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT, TYPE_LONG, TYPE_OBJECT, TYPE_SHORT, TYPE_STRING
 
Constructor Summary
XMLNodeList(Node parent, boolean caseSensitive)
           
XMLNodeList(Node parent, boolean caseSensitive, String filter)
           
 
Method Summary
 Object append(Object o)
          append a new value to the end of the array
 Object appendEL(Object o)
           
 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
 Object clone()
           
 int compareTo(boolean b)
           
 int compareTo(DateTime dt)
           
 int compareTo(double d)
           
 int compareTo(String str)
           
 boolean containsKey(Collection.Key key)
          contains this key
 boolean containsKey(int key)
          contains this key
 boolean containsKey(String key)
          contains this key
 Collection duplicate(boolean deepCopy)
           
 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
 Object get(int key, Object defaultValue)
          return object a given position, key can only be a integer from 1 to array len
 Object get(String key)
          return a value from the collection
 Object get(String key, Object defaultValue)
          return a value from the collection, if key doesn't exist, dont throw a exception, reeturns null
 boolean getCaseSensitive()
           
 int getDimension()
          return dimension of the array
 Object getE(int key)
          return object a given position, key can only be a integer from 1 to array len
 int getLength()
           
 boolean insert(int index, Object value)
          insert a value add defined position
 int[] intKeys()
           
 Node item(int index)
           
 Iterator iterator()
           
 Iterator keyIterator()
           
 Collection.Key[] keys()
           
 String[] keysAsString()
           
 Object prepend(Object o)
          add a new value to the begin of the array
 Object remove(Collection.Key key)
          removes value from collection and return it when it exists, otherwise throws a exception
 Object removeE(int index)
          removes a value ad defined key
 Object removeEL(Collection.Key key)
          removes value from collection and return it when it exists, otherwise returns null
 Object removeEL(int index)
          removes a value ad defined key
 void resize(int to)
          resize array to defined size
 Object set(Collection.Key key, Object value)
          sets a value to the collection
 Object set(String key, Object value)
          sets a value to the collection
 Object setE(int index, Object value)
          set value at defined position
 Object setEL(Collection.Key key, Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
 Object setEL(int index, Object value)
          set value at defined position, on error return null
 Object setEL(String key, Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
 int size()
           
 long sizeOf()
          return the size of the object
 void sort(String sortType, String sortOrder)
          sort values of a array
 Object[] toArray()
           
 ArrayList toArrayList()
           
 DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp)
          method to print out information to a object as HTML
 String toPlain()
           
 Iterator valueIterator()
           
 
Methods inherited from class railo.runtime.type.util.ArraySupport
add, add, addAll, addAll, contains, containsAll, equals, get, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toList, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
hashCode
 

Constructor Detail

XMLNodeList

public XMLNodeList(Node parent,
                   boolean caseSensitive)
Parameters:
parent - Parent Node
caseSensitive -

XMLNodeList

public XMLNodeList(Node parent,
                   boolean caseSensitive,
                   String filter)
Method Detail

getLength

public int getLength()
Specified by:
getLength in interface NodeList
See Also:
NodeList.getLength()

item

public Node item(int index)
Specified by:
item in interface NodeList
See Also:
NodeList.item(int)

size

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

keysAsString

public String[] keysAsString()
Returns:
returns a string array of all keys in the collection
See Also:
Collection.keysAsString()

keys

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

intKeys

public int[] intKeys()
Specified by:
intKeys in interface Array
Returns:
return all array keys as int
See Also:
Array.intKeys()

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

Parameters:
key - key of the collection
Returns:
removed Object

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

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

removeEL

public Object removeEL(int index)
Description copied from interface: Array
removes a value ad defined key

Specified by:
removeEL in interface Array
Parameters:
index - key to remove
Returns:
retuns if value is removed or not
See Also:
Array.removeEL(int)

removeE

public Object removeE(int index)
               throws PageException
Description copied from interface: Array
removes a value ad defined key

Specified by:
removeE in interface Array
Parameters:
index - key to remove
Returns:
retuns if value is removed or not
Throws:
PageException
See Also:
Array.removeE(int)

clear

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

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

get

public Object get(String key)
           throws ExpressionException
Description copied from interface: Collection
return a value from the collection

Parameters:
key - key of the value to get
Returns:
value on key position
Throws:
ExpressionException
See Also:
Collection.get(java.lang.String)

get

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

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

getE

public Object getE(int key)
            throws ExpressionException
Description copied from interface: Array
return object a given position, key can only be a integer from 1 to array len

Specified by:
getE in interface Array
Parameters:
key - key as integer
Returns:
value at key position
Throws:
ExpressionException
See Also:
Array.getE(int)

get

public Object get(String 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

Parameters:
key - key of the value to get
Returns:
value on key position or null
See Also:
Collection.get(java.lang.String, java.lang.Object)

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

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)

get

public Object get(int key,
                  Object defaultValue)
Description copied from interface: Array
return object a given position, key can only be a integer from 1 to array len

Specified by:
get in interface Array
Parameters:
key - key as integer
Returns:
value at key position
See Also:
Array.get(int, java.lang.Object)

set

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

Parameters:
key - key of the new value
value - value to set
Returns:
value setted
Throws:
PageException
See Also:
Collection.set(java.lang.String, java.lang.Object)

set

public Object set(Collection.Key key,
                  Object value)
           throws PageException
Description copied from interface: Collection
sets a value to the 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)

setE

public Object setE(int index,
                   Object value)
            throws PageException
Description copied from interface: Array
set value at defined position

Specified by:
setE in interface Array
Returns:
defined value
Throws:
PageException
See Also:
Array.setE(int, java.lang.Object)

setEL

public Object setEL(String 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

Parameters:
key - key of the value to get
value - value to set
Returns:
value on key position or null
See Also:
Collection.setEL(java.lang.String, 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

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)

setEL

public Object setEL(int index,
                    Object value)
Description copied from interface: Array
set value at defined position, on error return null

Specified by:
setEL in interface Array
Parameters:
index - key of the new value
value - value to set
Returns:
setted value
See Also:
Array.setEL(int, 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()

valueIterator

public Iterator valueIterator()
Specified by:
valueIterator in interface Iteratorable
Overrides:
valueIterator in class ArraySupport
Returns:
return a Iterator for Values
See Also:
Iteratorable.valueIterator()

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface List
Specified by:
iterator in interface Iteratorable
Returns:
return a Iterator for keys
See Also:
Iteratorable.iterator()

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
Returns:
HTML print out
See Also:
railo.runtime.dump.Dumpable#toDumpData(railo.runtime.PageContext, int)

append

public Object append(Object o)
              throws PageException
Description copied from interface: Array
append a new value to the end of the array

Specified by:
append in interface Array
Parameters:
o - value to insert
Returns:
inserted value
Throws:
PageException
See Also:
Array.append(java.lang.Object)

appendEL

public Object appendEL(Object o)
Specified by:
appendEL in interface Array

clone

public Object clone()
Overrides:
clone in class ArraySupport
Returns:
this object cloned
See Also:
Object.clone()

duplicate

public Collection duplicate(boolean deepCopy)
See Also:
Collection.duplicate(boolean)

getDimension

public int getDimension()
Description copied from interface: Array
return dimension of the array

Specified by:
getDimension in interface Array
Returns:
dimension of the array
See Also:
Array.getDimension()

insert

public boolean insert(int index,
                      Object value)
               throws PageException
Description copied from interface: Array
insert a value add defined position

Specified by:
insert in interface Array
Parameters:
index - position to insert
value - value to insert
Returns:
has done or not
Throws:
PageException
See Also:
Array.insert(int, java.lang.Object)

prepend

public Object prepend(Object o)
               throws PageException
Description copied from interface: Array
add a new value to the begin of the array

Specified by:
prepend in interface Array
Parameters:
o - value to insert
Returns:
inserted value
Throws:
PageException
See Also:
Array.prepend(java.lang.Object)

resize

public void resize(int to)
            throws ExpressionException
Description copied from interface: Array
resize array to defined size

Specified by:
resize in interface Array
Parameters:
to - new minimum size of the array
Throws:
ExpressionException
See Also:
Array.resize(int)

sort

public void sort(String sortType,
                 String sortOrder)
          throws ExpressionException
Description copied from interface: Array
sort values of a array

Specified by:
sort in interface Array
Parameters:
sortType - search type (text,textnocase,numeric)
sortOrder - (asc,desc)
Throws:
ExpressionException
See Also:
Array.sort(java.lang.String, java.lang.String)

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Specified by:
toArray in interface Array
Returns:
return arra as native (Java) Object Array
See Also:
Array.toArray()

toArrayList

public ArrayList toArrayList()
See Also:
railo.runtime.type.Array#toArrayList()

toPlain

public String toPlain()
Returns:
returns a output from the content as plain Text

containsKey

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

Overrides:
containsKey in class ArraySupport
Returns:
returns if collection has a key with given name
See Also:
Collection.containsKey(java.lang.String)

containsKey

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

Overrides:
containsKey in class ArraySupport
Returns:
returns if collection has a key with given name
See Also:
Collection.containsKey(railo.runtime.type.Collection.Key)

containsKey

public boolean containsKey(int key)
Description copied from interface: Array
contains this key

Specified by:
containsKey in interface Array
Overrides:
containsKey in class ArraySupport
Returns:
returns if collection has a key with given name
See Also:
Array.containsKey(int)

getCaseSensitive

public boolean getCaseSensitive()
Specified by:
getCaseSensitive in interface XMLObject
Returns:
return if case sensitive is defined for object
See Also:
XMLObject.getCaseSensitive()

castToString

public String castToString()
                    throws ExpressionException
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 ArraySupport
Returns:
String representation of the Object
Throws:
ExpressionException
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 ArraySupport
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 ArraySupport
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 ArraySupport
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 ArraySupport
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 ArraySupport
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 ArraySupport
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 ArraySupport
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 ExpressionException
Specified by:
compareTo in interface Castable
Overrides:
compareTo in class ArraySupport
Throws:
ExpressionException
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 ArraySupport
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 ArraySupport
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 ArraySupport
Throws:
PageException
See Also:
Castable.compareTo(java.lang.String)

sizeOf

public long sizeOf()
Description copied from interface: Sizeable
return the size of the object

Specified by:
sizeOf in interface Sizeable
Returns:
size of the object
See Also:
Sizeable.sizeOf()


Copyright © 2012 Railo