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, ForEachIteratorable, Iteratorable, Objects, Argument, BindScope, Scope, Sizeable, Struct

public final class ArgumentImpl
extends ScopeSupport
implements Argument

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 interface railo.runtime.type.scope.Argument
NULL
 
Fields inherited from interface railo.runtime.type.scope.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_VAR, SCOPE_VARIABLES
 
Fields inherited from interface railo.runtime.type.Struct
TYPE_LINKED, TYPE_REGULAR, TYPE_SOFT, 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)
           
 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 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
 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
 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
 void release(PageContext pc)
          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 set(PageContext pc, Collection.Key propertyName, Object value)
          sets a property (Data Member) value of the object
 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
 Object setEL(PageContext pc, Collection.Key propertyName, Object value)
          sets a property (Data Member) value of the object
 void setFunctionArgumentNames(Set functionArgumentNames)
           
 void sort(Comparator com)
           
 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, entryIterator, equals, g, g, hashCode, keyIterator, keys, keysAsStringIterator, 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, get, get, get, getIterator, invalidKey, isEmpty, keySet, put, putAll, remove, set, setEL, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface railo.runtime.type.scope.Scope
getType, getTypeAsString, initialize, isInitalized
 
Methods inherited from interface railo.runtime.type.Collection
clear, clone, containsKey, get, get, keys, remove, removeEL, set, set, setEL, setEL, size
 
Methods inherited from interface railo.runtime.type.Iteratorable
entryIterator, keyIterator, keysAsStringIterator, valueIterator
 
Methods inherited from interface railo.runtime.type.ForEachIteratorable
getIterator
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from interface railo.runtime.type.Sizeable
sizeOf
 
Methods inherited from interface railo.runtime.op.Castable
castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, compareTo, compareTo, compareTo, compareTo
 

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

release

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

Specified by:
release in interface Scope
Overrides:
release in class ScopeSupport

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

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

getFunctionArgument

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

getFunctionArgument

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

containsFunctionArgumentKey

public boolean containsFunctionArgumentKey(Collection.Key key)
Specified by:
containsFunctionArgumentKey in interface Argument

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

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

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

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

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

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

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

intKeys

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

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

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

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

appendEL

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

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

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

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

sort

public void sort(Comparator com)
          throws ExpressionException
Specified by:
sort in interface Array
Throws:
ExpressionException

toArray

public Object[] toArray()
Specified by:
toArray in interface Array
Returns:
return arra as native (Java) Object Array

setArgument

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

toArrayList

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

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

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

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

toList

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

duplicate

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

setFunctionArgumentNames

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

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

get

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

Specified by:
get in interface Objects
Overrides:
get in class StructSupport
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
Overrides:
get in class StructSupport
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
Overrides:
set in class StructSupport
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
Overrides:
setEL in class StructSupport
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
Overrides:
call in class StructSupport
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
Overrides:
callWithNamedValues in class StructSupport
Parameters:
pc - PageContext
methodName - name of the method
args - Named Arguments for the method
Returns:
return result of the method
Throws:
PageException


Copyright © 2012 Railo