Package ortus.boxlang.runtime.dynamic
Class Referencer
java.lang.Object
ortus.boxlang.runtime.dynamic.Referencer
I handle dereferencing of objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Objectget(IBoxContext context, Object object, Key key, Boolean safe) Used to implement any time an object is dereferenced,static ObjectgetAndInvoke(IBoxContext context, Object object, Key key, Boolean safe) Used to implement any time an object is dereferenced,static ObjectgetAndInvoke(IBoxContext context, Object object, Key key, Object[] positionalArguments, Boolean safe) Used to implement any time an object is dereferenced,static ObjectgetAndInvoke(IBoxContext context, Object object, Key key, Map<Key, Object> namedArguments, Boolean safe) Used to implement any time an object is dereferenced,static Objectset(IBoxContext context, boolean isFinal, Object object, Key key, Object value) Used to implement any time an object is assigned to,static Objectset(IBoxContext context, Object object, Key key, Object value) Used to implement any time an object is assigned to,static ObjectsetDeep(IBoxContext context, boolean isFinal, Key mustBeScopeName, Object object, Object value, Key... keys) Used to implement any time an object is assigned via deep keys like foo.bar.baz=1 Missing keys will be created as needed as HashMaps An exception will be thrown if any intermediate keys exists, but are not a Map.static ObjectsetDeep(IBoxContext context, boolean isFinal, Key mustBeScopeName, IBoxContext.ScopeSearchResult scopeSearchResult, Object value, Key... keys) static ObjectsetDeep(IBoxContext context, Object object, Object value, Key... keys) static ObjectsetDeep(IBoxContext context, IBoxContext.ScopeSearchResult scopeSearchResult, Object value, Key... keys) Used to implement any time an object is assigned via deep keys like foo.bar.baz=1 Missing keys will be created as needed as HashMaps An exception will be thrown if any intermediate keys exists, but are not a Map.
-
Constructor Details
-
Referencer
public Referencer()
-
-
Method Details
-
get
Used to implement any time an object is dereferenced,- Parameters:
context- The context we're executing inside ofobject- The object to dereferencekey- The key to dereferencesafe- Whether to throw an exception if the key is not found- Returns:
- The value that was dereferenced
-
getAndInvoke
public static Object getAndInvoke(IBoxContext context, Object object, Key key, Object[] positionalArguments, Boolean safe) Used to implement any time an object is dereferenced,- Parameters:
object- The object to dereferencekey- The key to dereferencepositionalArguments- The arguments to pass to the methodsafe- Whether to throw an exception if the key is not found- Returns:
- The value that was assigned
-
getAndInvoke
Used to implement any time an object is dereferenced,- Parameters:
object- The object to dereferencekey- The key to dereferencesafe- Whether to throw an exception if the key is not found- Returns:
- The value that was assigned
-
getAndInvoke
public static Object getAndInvoke(IBoxContext context, Object object, Key key, Map<Key, Object> namedArguments, Boolean safe) Used to implement any time an object is dereferenced,- Parameters:
object- The object to dereferencekey- The key to dereferencenamedArguments- The arguments to pass to the methodsafe- Whether to throw an exception if the key is not found- Returns:
- The value that was assigned
-
set
public static Object set(IBoxContext context, boolean isFinal, Object object, Key key, Object value) Used to implement any time an object is assigned to,- Parameters:
context- The context we're executing inside ofisFinal- Whether the assignment is finalobject- The object to dereferencekey- The key to dereferencevalue- The value to assign- Returns:
- The value that was assigned
-
set
Used to implement any time an object is assigned to,- Parameters:
context- The context we're executing inside ofobject- The object to dereferencekey- The key to dereferencevalue- The value to assign- Returns:
- The value that was assigned
-
setDeep
public static Object setDeep(IBoxContext context, boolean isFinal, Key mustBeScopeName, Object object, Object value, Key... keys) Used to implement any time an object is assigned via deep keys like foo.bar.baz=1 Missing keys will be created as needed as HashMaps An exception will be thrown if any intermediate keys exists, but are not a Map.- Parameters:
context- The context we're executing inside ofobject- The object to dereferencevalue- The value to assignkeys- The keys to dereference- Returns:
- The value that was assigned
-
setDeep
-
setDeep
public static Object setDeep(IBoxContext context, IBoxContext.ScopeSearchResult scopeSearchResult, Object value, Key... keys) Used to implement any time an object is assigned via deep keys like foo.bar.baz=1 Missing keys will be created as needed as HashMaps An exception will be thrown if any intermediate keys exists, but are not a Map.- Parameters:
context- The context we're executing inside ofscopeSearchResult- The scope search resultvalue- The value to assignkeys- The keys to dereference- Returns:
- The value that was assigned
-
setDeep
public static Object setDeep(IBoxContext context, boolean isFinal, Key mustBeScopeName, IBoxContext.ScopeSearchResult scopeSearchResult, Object value, Key... keys)
-