railo.runtime.type.util
Class StructSupport

java.lang.Object
  extended by railo.runtime.type.util.StructSupport
All Implemented Interfaces:
Serializable, Cloneable, Map, Dumpable, Castable, Collection, ForEachIteratorable, Iteratorable, Objects, Sizeable, Struct
Direct Known Subclasses:
CallerImpl, ClusterNotSupported, CollectionStruct, ComponentImpl, ComponentScopeShadow, ComponentScopeThis, ComponentWrap, Excel, FileStreamWrapper, Image, LocalNotSupportedScope, MapAsStruct, ObjectStruct, PDFDocument, RequestImpl, StorageScopeImpl, StructImpl, StructImplKey, SVStruct, ThreadsImpl, UndefinedImpl, UrlFormImpl, XMLAttributes, XMLNodeStruct

public abstract class StructSupport
extends Object
implements Map, Struct, Sizeable

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_SOFT, TYPE_SYNC, TYPE_WEAKED
 
Constructor Summary
StructSupport()
           
 
Method Summary
 Object call(PageContext pc, Collection.Key methodName, Object[] args)
          calls a method of the object
 Object callWithNamedValues(PageContext pc, Collection.Key methodName, Struct args)
          call a method of the Object with named arguments
 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
 Object clone()
           
 int compareTo(boolean b)
           
 int compareTo(DateTime dt)
           
 int compareTo(double d)
           
 int compareTo(String str)
           
 boolean containsKey(Object key)
           
 boolean containsKey(String key)
          contains this key
 boolean containsValue(Object value)
           
 Set entrySet()
           
 boolean equals(Object obj)
           
 Object get(Object key)
           
 Object get(PageContext pc, Collection.Key key)
          return property or getter of the ContextCollection
 Object get(PageContext pc, Collection.Key key, Object defaultValue)
          return property
 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
 Iterator<String> getIterator()
           
 int hashCode()
           
static ExpressionException invalidKey(Struct sct, Collection.Key key)
          throw exception for invalid key
 boolean isEmpty()
           
 Iterator<String> keysAsStringIterator()
           
 Set keySet()
           
 Object put(Object key, Object value)
           
 void putAll(Map t)
           
 Object remove(Object key)
           
 Object set(PageContext pc, Collection.Key propertyName, Object value)
          sets a property (Data Member) value of the object
 Object set(String key, Object value)
          sets a value to the collection
 Object setEL(PageContext pc, Collection.Key propertyName, Object value)
          sets a property (Data Member) value of the object
 Object setEL(String key, Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
 long sizeOf()
          return the size of the object
 DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties properties)
          method to print out information to a object as HTML
 String toString()
           
 Collection values()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface railo.runtime.type.Collection
clear, containsKey, duplicate, get, get, keys, remove, removeEL, set, setEL, size
 
Methods inherited from interface railo.runtime.type.Iteratorable
entryIterator, keyIterator, valueIterator
 
Methods inherited from interface java.util.Map
clear, size
 

Constructor Detail

StructSupport

public StructSupport()
Method Detail

invalidKey

public static ExpressionException invalidKey(Struct sct,
                                             Collection.Key key)
throw exception for invalid key

Parameters:
key - Invalid key
Returns:
returns an invalid key Exception

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

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map

get

public final Object get(Object key)
Specified by:
get in interface Map

isEmpty

public final boolean isEmpty()
Specified by:
isEmpty in interface Map

keySet

public Set keySet()
Specified by:
keySet in interface Map

put

public final Object put(Object key,
                        Object value)
Specified by:
put in interface Map

putAll

public final void putAll(Map t)
Specified by:
putAll in interface Map

remove

public final Object remove(Object key)
Specified by:
remove in interface Map

clone

public final Object clone()
Specified by:
clone in interface Collection
Overrides:
clone in class Object
Returns:
this object cloned

containsKey

public final boolean containsKey(Object key)
Specified by:
containsKey in interface Map

containsKey

public final boolean containsKey(String 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

get

public final 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

Specified by:
get in interface Collection
Parameters:
key - key of the value to get
Returns:
value on key position or null

get

public final Object get(String 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
Returns:
value on key position
Throws:
PageException

set

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

setEL

public final 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

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

toDumpData

public DumpData toDumpData(PageContext pageContext,
                           int maxlevel,
                           DumpProperties properties)
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

castToBooleanValue

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

Specified by:
castToBooleanValue in interface Castable
Returns:
boolean Value representation of the Object
Throws:
PageException

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
Returns:
boolean Value representation of the Object

castToDoubleValue

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

Specified by:
castToDoubleValue in interface Castable
Returns:
double Value representation of the Object
Throws:
PageException

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
Returns:
double Value representation of the Object

castToDateTime

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

Specified by:
castToDateTime in interface Castable
Returns:
date time representation of the Object
Throws:
PageException

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
Parameters:
defaultValue - returned when it is not possible to cast to a dateTime object
Returns:
date time representation of the Object

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
Returns:
String representation of the Object
Throws:
PageException

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
Returns:
String representation of the Object

compareTo

public int compareTo(boolean b)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException

compareTo

public int compareTo(DateTime dt)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException

compareTo

public int compareTo(double d)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException

compareTo

public int compareTo(String str)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException

toString

public String toString()
Overrides:
toString in class Object

values

public Collection values()
Specified by:
values in interface Map

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map

keysAsStringIterator

public Iterator<String> keysAsStringIterator()
Specified by:
keysAsStringIterator in interface Iteratorable
Returns:
return a Iterator for Keys as String

get

public Object get(PageContext pc,
                  Collection.Key key,
                  Object defaultValue)
Description copied from interface: Objects
return property

Specified by:
get in interface Objects
Parameters:
pc - PageContext
key - Name of the Property
Returns:
return value of the Property

get

public Object get(PageContext pc,
                  Collection.Key key)
           throws PageException
Description copied from interface: Objects
return property or getter of the ContextCollection

Specified by:
get in interface Objects
Parameters:
pc - PageContext
key - Name of the Property
Returns:
return value of the Property
Throws:
PageException

set

public Object set(PageContext pc,
                  Collection.Key propertyName,
                  Object value)
           throws PageException
Description copied from interface: Objects
sets a property (Data Member) value of the object

Specified by:
set in interface Objects
propertyName - property name to set
value - value to insert
Returns:
value set to property
Throws:
PageException

setEL

public Object setEL(PageContext pc,
                    Collection.Key propertyName,
                    Object value)
Description copied from interface: Objects
sets a property (Data Member) value of the object

Specified by:
setEL in interface Objects
propertyName - property name to set
value - value to insert
Returns:
value set to property

call

public Object call(PageContext pc,
                   Collection.Key methodName,
                   Object[] args)
            throws PageException
Description copied from interface: Objects
calls a method of the object

Specified by:
call in interface Objects
methodName - name of the method to call
args - arguments to call method with
Returns:
return value of the method
Throws:
PageException

callWithNamedValues

public Object callWithNamedValues(PageContext pc,
                                  Collection.Key methodName,
                                  Struct args)
                           throws PageException
Description copied from interface: Objects
call a method of the Object with named arguments

Specified by:
callWithNamedValues in interface Objects
Parameters:
pc - PageContext
methodName - name of the method
args - Named Arguments for the method
Returns:
return result of the method
Throws:
PageException

getIterator

public Iterator<String> getIterator()
Specified by:
getIterator in interface ForEachIteratorable

equals

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

hashCode

public int hashCode()
Specified by:
hashCode in interface Map
Overrides:
hashCode in class Object


Copyright © 2012 Railo