railo.runtime.type.scope
Class Closure

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.Closure
All Implemented Interfaces:
Serializable, Cloneable, Map, Dumpable, Castable, Collection, ForEachIteratorable, Iteratorable, Objects, Scope, Variables, Sizeable, Struct

public class Closure
extends ScopeSupport
implements Variables

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.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
Closure(PageContext pc, Argument arg, Local local, Variables var)
           
 
Method Summary
 void clear()
          clears the collection
 boolean containsKey(Collection.Key key)
          contains this key
 Collection duplicate(boolean deepCopy)
           
 Iterator<Map.Entry<Collection.Key,Object>> entryIterator()
           
 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
 int getType()
           
 String getTypeAsString()
           
 void initialize(PageContext pc)
          Initalize Scope
 boolean isBind()
           
 boolean isInitalized()
          return if the scope is Initialiesd
 Iterator<Collection.Key> keyIterator()
           
 Collection.Key[] keys()
           
 Iterator<String> keysAsStringIterator()
           
 void release()
          release scope for reuse
 void release(PageContext pc)
          release scope for reuse
 Object remove(Collection.Key key)
          removes value from collection and return it when it exists, otherwise throws a exception
 Object removeEL(Collection.Key key)
          removes value from collection and return it when it exists, otherwise returns null
 Object set(Collection.Key key, Object value)
          sets a value to the collection
 void setBind(boolean bind)
          sets if scope is binded to a closure
 Object setEL(Collection.Key key, Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
 int size()
           
 DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties properties)
          method to print out information to a object as HTML
 Iterator<Object> valueIterator()
           
 
Methods inherited from class railo.runtime.type.scope.ScopeSupport
_getId, sizeOf, toDumpData
 
Methods inherited from class railo.runtime.type.StructImpl
containsValue, copy, equals, g, g, hashCode, values
 
Methods inherited from class railo.runtime.type.util.StructSupport
call, callWithNamedValues, castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, clone, compareTo, compareTo, compareTo, compareTo, containsKey, containsKey, entrySet, get, get, get, get, get, getIterator, invalidKey, isEmpty, keySet, put, putAll, remove, set, set, setEL, setEL, toString
 
Methods inherited from class java.lang.Object
getClass, 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.ForEachIteratorable
getIterator
 
Methods inherited from interface java.util.Map
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, values
 
Methods inherited from interface railo.runtime.type.Sizeable
sizeOf
 
Methods inherited from interface railo.runtime.type.Objects
call, callWithNamedValues, get, get, set, setEL
 
Methods inherited from interface railo.runtime.op.Castable
castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, compareTo, compareTo, compareTo, compareTo
 

Constructor Detail

Closure

public Closure(PageContext pc,
               Argument arg,
               Local local,
               Variables var)
Method Detail

isInitalized

public boolean isInitalized()
Description copied from interface: Scope
return if the scope is Initialiesd

Specified by:
isInitalized in interface Scope
Overrides:
isInitalized in class ScopeSupport
Returns:
scope is init

initialize

public void initialize(PageContext pc)
Description copied from interface: Scope
Initalize Scope

Specified by:
initialize in interface Scope
Overrides:
initialize in class ScopeSupport
Parameters:
pc - Page Context

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

getType

public int getType()
Specified by:
getType in interface Scope
Overrides:
getType in class ScopeSupport
Returns:
return the scope type (SCOPE_SERVER, SCOPE_SESSION usw.)

getTypeAsString

public String getTypeAsString()
Specified by:
getTypeAsString in interface Scope
Overrides:
getTypeAsString in class ScopeSupport
Returns:
return the scope type as a String (server,session usw.)

size

public int size()
Specified by:
size in interface Map
Specified by:
size in interface Collection
Overrides:
size in class StructImpl
Returns:
the size of the collection

keys

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

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
Overrides:
remove in class StructImpl
Parameters:
key - key of the collection
Returns:
removed Object
Throws:
PageException

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
Overrides:
removeEL in class StructImpl
Parameters:
key - key of the collection
Returns:
removed Object

clear

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

Specified by:
clear in interface Map
Specified by:
clear in interface Collection
Overrides:
clear in class StructImpl

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
Overrides:
get in class StructImpl
Parameters:
key - key of the value to get must be lower case
Returns:
value on key position
Throws:
PageException

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

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
Overrides:
set in class StructImpl
Parameters:
key - key of the new value
value - value to set
Returns:
value setted
Throws:
PageException

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
Overrides:
setEL in class StructImpl
Parameters:
key - key of the value to get
value - value to set
Returns:
value on key position or null

duplicate

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

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

keyIterator

public Iterator<Collection.Key> keyIterator()
Specified by:
keyIterator in interface Iteratorable
Overrides:
keyIterator in class StructImpl
Returns:
return a Iterator for Keys as Collection.Keys

keysAsStringIterator

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

entryIterator

public Iterator<Map.Entry<Collection.Key,Object>> entryIterator()
Specified by:
entryIterator in interface Iteratorable
Overrides:
entryIterator in class StructImpl

valueIterator

public Iterator<Object> valueIterator()
Specified by:
valueIterator in interface Iteratorable
Overrides:
valueIterator in class StructImpl
Returns:
return a Iterator for Values

setBind

public void setBind(boolean bind)
Description copied from interface: Variables
sets if scope is binded to a closure

Specified by:
setBind in interface Variables

isBind

public boolean isBind()
Specified by:
isBind in interface Variables
Returns:
returns if scope is binded to a closure

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
Overrides:
toDumpData in class ScopeSupport
Returns:
HTML print out


Copyright © 2012 Railo