railo.runtime.type.scope
Class UndefinedImpl

java.lang.Object
  extended by railo.runtime.type.util.StructSupport
      extended by railo.runtime.type.scope.UndefinedImpl
All Implemented Interfaces:
Serializable, Cloneable, Map, Dumpable, Castable, Collection, ForEachIteratorable, Iteratorable, Objects, Scope, Undefined, Sizeable, Struct

public final class UndefinedImpl
extends StructSupport
implements Undefined

Undefined 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.Undefined
MODE_LOCAL_OR_ARGUMENTS_ALWAYS, MODE_LOCAL_OR_ARGUMENTS_ONLY_WHEN_EXISTS, MODE_NO_LOCAL_AND_ARGUMENTS
 
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
UndefinedImpl(PageContextImpl pc, short type)
          constructor of the class
 
Method Summary
 void addQuery(Query qry)
          add a collection to the undefined scope
 Argument argumentsScope()
           
 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
 void clear()
          clears the collection
 int compareTo(boolean b)
           
 int compareTo(DateTime dt)
           
 int compareTo(double d)
           
 int compareTo(String str)
           
 boolean containsKey(Collection.Key key)
          contains this key
static void debugCascadedAccess(PageContext pc, String name, Collection.Key key)
           
static void debugCascadedAccess(PageContext pc, Variables var, Object value, Collection.Key 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
 Object getCascading(Collection.Key key)
          gets a key from all cascaded scopes, but not from variables scope
 Object getCascading(Collection.Key key, Object defaultValue)
           
 Object getCascading(String strKey)
          gets a key from all cascaded scopes, but not from variables scope
 boolean getCheckArguments()
           
 Object getCollection(Collection.Key key)
          return value matching key, if value is from Query return a QueryColumn
 Object getCollection(String key)
          return value matching key, if value is from Query return a QueryColumn
 boolean getLocalAlways()
           
 QueryStack getQueryStack()
           
 Struct getScope(Collection.Key key)
           
 List<String> getScopeNames()
          return a list of String with the scope names
 int getType()
           
 String getTypeAsString()
           
 void initialize(PageContext pc)
          Initalize Scope
 boolean isAllowImplicidQueryCall()
           
 boolean isInitalized()
          return if the scope is Initialiesd
 Iterator<Collection.Key> keyIterator()
           
 Collection.Key[] keys()
           
 Iterator<String> keysAsStringIterator()
           
 Local localScope()
           
 void reinitialize(PageContext pc)
           
 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
 void removeQuery()
          remove a collection from the undefined scope
 Object set(Collection.Key key, Object value)
          sets a value to the collection
 boolean setAllowImplicidQueryCall(boolean allowImplicidQueryCall)
           
 Object setEL(Collection.Key key, Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
 void setFunctionScopes(Local local, Argument argument)
          sets the functions scopes
 int setMode(int mode)
          sets mode of scope
 void setQueryStack(QueryStack qryStack)
          sets a individual query stack to the undefined scope
 void setVariableScope(Variables scope)
          change the variable scope
 int size()
           
 DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp)
          method to print out information to a object as HTML
 Iterator<Object> valueIterator()
           
 Variables variablesScope()
           
 
Methods inherited from class railo.runtime.type.util.StructSupport
clone, containsKey, containsKey, containsValue, entrySet, equals, get, get, get, get, get, getIterator, hashCode, invalidKey, isEmpty, keySet, put, putAll, remove, set, set, setEL, setEL, sizeOf, toString, values
 
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
get, get, set, setEL
 

Constructor Detail

UndefinedImpl

public UndefinedImpl(PageContextImpl pc,
                     short type)
constructor of the class

Parameters:
pageContextImpl -
type - type of the undefined scope (ServletConfigImpl.SCOPE_STRICT;ServletConfigImpl.SCOPE_SMALL;ServletConfigImpl.SCOPE_STANDART)
Method Detail

localScope

public Local localScope()
Specified by:
localScope in interface Undefined
Returns:
returns the current local scope defined in the undefined scope

argumentsScope

public Argument argumentsScope()
Specified by:
argumentsScope in interface Undefined

variablesScope

public Variables variablesScope()
Specified by:
variablesScope in interface Undefined

setMode

public int setMode(int mode)
Description copied from interface: Undefined
sets mode of scope

Specified by:
setMode in interface Undefined
Parameters:
mode - new mode
Returns:
old mode

getLocalAlways

public boolean getLocalAlways()
Specified by:
getLocalAlways in interface Undefined

setFunctionScopes

public void setFunctionScopes(Local local,
                              Argument argument)
Description copied from interface: Undefined
sets the functions scopes

Specified by:
setFunctionScopes in interface Undefined
Parameters:
local - local scope
argument - argument scope

getQueryStack

public QueryStack getQueryStack()
Specified by:
getQueryStack in interface Undefined
Returns:
returns actuell collection stack

setQueryStack

public void setQueryStack(QueryStack qryStack)
Description copied from interface: Undefined
sets a individual query stack to the undefined scope

Specified by:
setQueryStack in interface Undefined
Parameters:
qryStack - Query stack

addQuery

public void addQuery(Query qry)
Description copied from interface: Undefined
add a collection to the undefined scope

Specified by:
addQuery in interface Undefined
Parameters:
qry - Query to add to undefined scope

removeQuery

public void removeQuery()
Description copied from interface: Undefined
remove a collection from the undefined scope

Specified by:
removeQuery in interface Undefined

size

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

keys

public Collection.Key[] keys()
Specified by:
keys in interface Collection
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
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
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

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

debugCascadedAccess

public static void debugCascadedAccess(PageContext pc,
                                       Variables var,
                                       Object value,
                                       Collection.Key key)

debugCascadedAccess

public static void debugCascadedAccess(PageContext pc,
                                       String name,
                                       Collection.Key key)

getCollection

public Object getCollection(String key)
                     throws PageException
Description copied from interface: Undefined
return value matching key, if value is from Query return a QueryColumn

Specified by:
getCollection in interface Undefined
Returns:
return matched value
Throws:
PageException

getScope

public Struct getScope(Collection.Key key)
Specified by:
getScope in interface Undefined

getScopeNames

public List<String> getScopeNames()
return a list of String with the scope names

Specified by:
getScopeNames in interface Undefined
Parameters:
key -
Returns:

getCollection

public Object getCollection(Collection.Key key)
                     throws PageException
Description copied from interface: Undefined
return value matching key, if value is from Query return a QueryColumn

Specified by:
getCollection in interface Undefined
Returns:
return matched value
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
Parameters:
key - key of the value to get
Returns:
value on key position or null

getCascading

public Object getCascading(String strKey)
Description copied from interface: Undefined
gets a key from all cascaded scopes, but not from variables scope

Specified by:
getCascading in interface Undefined
Parameters:
strKey - key to get
Returns:
matching value or null

getCascading

public Object getCascading(Collection.Key key)
Description copied from interface: Undefined
gets a key from all cascaded scopes, but not from variables scope

Specified by:
getCascading in interface Undefined
Parameters:
key - key to get
Returns:
matching value or null

getCascading

public Object getCascading(Collection.Key key,
                           Object defaultValue)

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
Parameters:
key - key of the value to get
value - value to set
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
Parameters:
key - key of the new value
value - value to set
Returns:
value setted
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 StructSupport
Returns:
HTML print out

keyIterator

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

keysAsStringIterator

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

entryIterator

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

valueIterator

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

isInitalized

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

Specified by:
isInitalized in interface Scope
Returns:
scope is init

initialize

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

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

reinitialize

public void reinitialize(PageContext pc)
Specified by:
reinitialize in interface Undefined

release

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

Specified by:
release in interface Scope

release

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

Specified by:
release in interface Scope

duplicate

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

containsKey

public boolean containsKey(Collection.Key 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

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

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

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

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

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

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

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 StructSupport
Returns:
date time representation of the Object
Throws:
ExpressionException

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

compareTo

public int compareTo(boolean b)
              throws ExpressionException
Specified by:
compareTo in interface Castable
Overrides:
compareTo in class StructSupport
Throws:
ExpressionException

compareTo

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

compareTo

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

compareTo

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

setVariableScope

public void setVariableScope(Variables scope)
Description copied from interface: Undefined
change the variable scope

Specified by:
setVariableScope in interface Undefined

getType

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

getTypeAsString

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

isAllowImplicidQueryCall

public boolean isAllowImplicidQueryCall()
Returns:
the allowImplicidQueryCall

setAllowImplicidQueryCall

public boolean setAllowImplicidQueryCall(boolean allowImplicidQueryCall)
Specified by:
setAllowImplicidQueryCall in interface Undefined
Parameters:
allowImplicidQueryCall - the allowImplicidQueryCall to set

getCheckArguments

public boolean getCheckArguments()
Specified by:
getCheckArguments in interface Undefined
Returns:
the checkArguments

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