Class Referencer

java.lang.Object
ortus.boxlang.runtime.dynamic.Referencer

public class Referencer extends Object
I handle dereferencing of objects
  • Constructor Details

    • Referencer

      public Referencer()
  • Method Details

    • get

      public static Object get(IBoxContext context, Object object, Key key, Boolean safe)
      Used to implement any time an object is dereferenced,
      Parameters:
      context - The context we're executing inside of
      object - The object to dereference
      key - The key to dereference
      safe - 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 dereference
      key - The key to dereference
      positionalArguments - The arguments to pass to the method
      safe - 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, Boolean safe)
      Used to implement any time an object is dereferenced,
      Parameters:
      object - The object to dereference
      key - The key to dereference
      safe - 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 dereference
      key - The key to dereference
      namedArguments - The arguments to pass to the method
      safe - 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 of
      isFinal - Whether the assignment is final
      object - The object to dereference
      key - The key to dereference
      value - The value to assign
      Returns:
      The value that was assigned
    • set

      public static Object set(IBoxContext context, Object object, Key key, Object value)
      Used to implement any time an object is assigned to,
      Parameters:
      context - The context we're executing inside of
      object - The object to dereference
      key - The key to dereference
      value - 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 of
      object - The object to dereference
      value - The value to assign
      keys - The keys to dereference
      Returns:
      The value that was assigned
    • setDeep

      public static Object setDeep(IBoxContext context, Object object, Object value, Key... keys)
    • 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 of
      scopeSearchResult - The scope search result
      value - The value to assign
      keys - 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)