railo.runtime.type.scope
Class ArgumentImpl

java.lang.Object
  extended by railo.runtime.type.util.StructSupport
      extended by railo.runtime.type.StructImpl
          extended by railo.runtime.type.scope.ScopeSupport
              extended by railo.runtime.type.scope.ArgumentImpl
All Implemented Interfaces:
Serializable, Cloneable, Map, Dumpable, Castable, Array, Collection, Iteratorable, Scope, Argument, ArgumentPro, BindScope, Sizeable, Struct

public final class ArgumentImpl
extends ScopeSupport
implements ArgumentPro

implementation of the argument scope

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 class railo.runtime.type.scope.ScopeSupport
APPLICATION, CGI, CLIENT, CLUSTER, COOKIE, FORM, REQUEST, SCOPE_COUNT, SCOPE_VAR, SESSION, URL
 
Fields inherited from class railo.runtime.type.StructImpl
TYPE_SOFT
 
Fields inherited from interface railo.runtime.type.scope.ArgumentPro
NULL
 
Fields inherited from interface railo.runtime.type.Scope
SCOPE_APPLICATION, SCOPE_ARGUMENTS, SCOPE_CALLER, SCOPE_CGI, SCOPE_CLIENT, SCOPE_CLUSTER, SCOPE_COOKIE, SCOPE_COUNT, SCOPE_FORM, SCOPE_LOCAL, SCOPE_REQUEST, SCOPE_SERVER, SCOPE_SESSION, SCOPE_UNDEFINED, SCOPE_URL, SCOPE_VARIABLES
 
Fields inherited from interface railo.runtime.type.Struct
TYPE_LINKED, TYPE_REGULAR, TYPE_SYNC, TYPE_WEAKED
 
Constructor Summary
ArgumentImpl()
          constructor of the class
 
Method Summary
 Object append(Object o)
          append a new value to the end of the array
 Object appendEL(Object o)
           
 boolean containsFunctionArgumentKey(Collection.Key key)
           
 boolean containsKey(Collection.Key key)
          contains this key
 boolean containsKey(int 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 intKey, Object defaultValue)
          return object a given position, key can only be a integer from 1 to array len
 int getDimension()
          return dimension of the array
 Object getE(int intKey)
          return a value matching to key
 Object getFunctionArgument(Collection.Key key, Object defaultValue)
           
 Object getFunctionArgument(String key, Object defaultValue)
           
 boolean insert(int index, Object value)
          insert a value add defined position
 boolean insert(int index, String key, Object value)
          insert a key in argument scope at defined position
 int[] intKeys()
           
 boolean isBind()
           
 Object prepend(Object o)
          add a new value to the begin of the array
 void release()
          release scope for reuse
 Object removeE(int intKey)
          removes a value ad defined key
 Object removeEL(int intKey)
          removes a value ad defined key
 void resize(int to)
          resize array to defined size
 Object setArgument(Object obj)
           
 void setBind(boolean bind)
          sets if scope is binded to a other variable for using outside of a udf
 Object setE(int intKey, Object value)
          set value at defined position
 Object setEL(int intKey, Object value)
          set value at defined position, on error return null
 void setFunctionArgumentNames(Set functionArgumentNames)
           
 void sort(String sortType, String sortOrder)
          sort values of a array
 Object[] toArray()
           
static Array toArray(Argument arg)
          converts a argument scope to a regular array
 ArrayList toArrayList()
           
 DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp)
          method to print out information to a object as HTML
 List toList()
           
static Struct toStruct(Argument arg)
          converts a argument scope to a regular struct
 
Methods inherited from class railo.runtime.type.scope.ScopeSupport
_getId, getType, getTypeAsString, initialize, isInitalized, sizeOf, toDumpData
 
Methods inherited from class railo.runtime.type.StructImpl
clear, containsValue, copy, keyIterator, keys, keysAsString, remove, remove, removeEL, set, setEL, size, valueIterator, values
 
Methods inherited from class railo.runtime.type.util.StructSupport
castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, clone, compareTo, compareTo, compareTo, compareTo, containsKey, containsKey, entrySet, equals, get, get, get, invalidKey, isEmpty, iterator, keySet, put, putAll, remove, set, setEL, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface railo.runtime.type.Scope
getType, getTypeAsString, initialize, isInitalized
 
Methods inherited from interface railo.runtime.type.Collection
clear, clone, containsKey, get, get, keys, keysAsString, remove, removeEL, set, set, setEL, setEL, size
 
Methods inherited from interface railo.runtime.type.Iteratorable
iterator, keyIterator, valueIterator
 
Methods inherited from interface railo.runtime.op.Castable
castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, compareTo, compareTo, compareTo, compareTo
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

ArgumentImpl

public ArgumentImpl()
constructor of the class

Method Detail

release

public void release()
Description copied from interface: Scope
release scope for reuse

Specified by:
release in interface Scope
Overrides:
release in class ScopeSupport
See Also:
ScopeSupport.release()

setBind

public void setBind(boolean bind)
Description copied from interface: Argument
sets if scope is binded to a other variable for using outside of a udf

Specified by:
setBind in interface Argument
Specified by:
setBind in interface BindScope
See Also:
Argument.setBind(boolean)

isBind

public boolean isBind()
Specified by:
isBind in interface Argument
Specified by:
isBind in interface BindScope
Returns:
returns if scope is binded to a other variable for using outside of a udf
See Also:
Argument.isBind()

getFunctionArgument

public Object getFunctionArgument(String key,
                                  Object defaultValue)
Specified by:
getFunctionArgument in interface ArgumentPro

getFunctionArgument

public Object getFunctionArgument(Collection.Key key,
                                  Object defaultValue)
Specified by:
getFunctionArgument in interface ArgumentPro

containsFunctionArgumentKey

public boolean containsFunctionArgumentKey(Collection.Key key)
Specified by:
containsFunctionArgumentKey in interface ArgumentPro
See Also:
ArgumentPro.containsFunctionArgumentKey(railo.runtime.type.Collection.Key)

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
Overrides:
get in class StructImpl
Parameters:
key - key of the value to get
Returns:
value on key position or null
See Also:
StructImpl.get(railo.runtime.type.Collection.Key, java.lang.Object)

get

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

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

get

public Object get(int intKey,
                  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:
intKey - key as integer
Returns:
value at key position
See Also:
Array.get(int, java.lang.Object)

getE

public Object getE(int intKey)
            throws PageException
return a value matching to key

Specified by:
getE in interface Array
Parameters:
intKey -
Returns:
value matching key
Throws:
PageException

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

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()

setEL

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

Specified by:
setEL in interface Array
Parameters:
intKey - key of the new value
value - value to set
Returns:
setted value
See Also:
Array.setEL(int, java.lang.Object)

setE

public Object setE(int intKey,
                   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)

intKeys

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

insert

public boolean insert(int index,
                      Object value)
               throws ExpressionException
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:
ExpressionException
See Also:
Array.insert(int, java.lang.Object)

insert

public boolean insert(int index,
                      String key,
                      Object value)
               throws ExpressionException
Description copied from interface: Argument
insert a key in argument scope at defined position

Specified by:
insert in interface Argument
Returns:
boolean
Throws:
ExpressionException
See Also:
Argument.insert(int, java.lang.String, java.lang.Object)

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
See Also:
Array.appendEL(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 PageException
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:
PageException
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 Array
Returns:
return arra as native (Java) Object Array
See Also:
Array.toArray()

setArgument

public Object setArgument(Object obj)
                   throws PageException
Specified by:
setArgument in interface ArgumentPro
Throws:
PageException

toArrayList

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

removeE

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

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

removeEL

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

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

containsKey

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

Specified by:
containsKey in interface Collection
Overrides:
containsKey in class StructImpl
Returns:
returns if collection has a key with given name
See Also:
StructImpl.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
Returns:
returns if collection has a key with given name
See Also:
Array.containsKey(int)

toList

public List toList()
Specified by:
toList in interface Array
Returns:
return array as ArrayList
See Also:
Array.toList()

duplicate

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

setFunctionArgumentNames

public void setFunctionArgumentNames(Set functionArgumentNames)
Specified by:
setFunctionArgumentNames in interface ArgumentPro

toStruct

public static Struct toStruct(Argument arg)
converts a argument scope to a regular struct

Parameters:
arg - argument scope to convert
Returns:
resulting struct

toArray

public static Array toArray(Argument arg)
converts a argument scope to a regular array

Parameters:
arg - argument scope to convert
Returns:
resulting array


Copyright © 2012 Railo