Class Bindings
- java.lang.Object
-
- org.forgerock.openig.el.Bindings
-
public class Bindings extends Object
Bindings represents the Expression bindings used during evaluation and assignation.
-
-
Constructor Summary
Constructors Constructor Description Bindings()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>asMap()Returns an unmodifiableMapview of thisBindingsinstance.Bindingsbind(String name, Object value)Binds a newvalueto the givenname.Bindingsbind(Bindings source)Binds all the bindings already bound fromsource.static Bindingsbindings()Returns an emptyBindingsinstance (mutable).static Bindingsbindings(String name, Object value)static Bindingsbindings(Context context)Returns aBindingsinitialized with the givencontextandrequest.static Bindingsbindings(Context context, Request request)Returns aBindingsinitialized with the givencontextandrequest.static Bindingsbindings(Context context, Request request, Response response)Returns aBindingsinitialized with the givencontext,requestandresponse.static Map<String,Context>flatten(Context leaf)Flatten the currentleafContextinto a Map keyed by context name.StringtoString()
-
-
-
Method Detail
-
bindings
public static Bindings bindings()
Returns an emptyBindingsinstance (mutable).- Returns:
- an empty
Bindingsinstance.
-
bindings
public static Bindings bindings(Context context)
Returns aBindingsinitialized with the givencontextandrequest.The returned bindings contain a
contextsentry that provides easy access to visible parent Contexts (contexts.http, contexts.client, ...).They also give access to the context's
attributesfrom theAttributesContextand to thesessionfrom theSessionContext.- Parameters:
context- The context to expose- Returns:
- an initialized
Bindingsinstance.
-
bindings
public static Bindings bindings(Context context, Request request)
Returns aBindingsinitialized with the givencontextandrequest.- Parameters:
context- The context to exposerequest- The request to expose- Returns:
- an initialized
Bindingsinstance.
-
bindings
public static Bindings bindings(Context context, Request request, Response response)
Returns aBindingsinitialized with the givencontext,requestandresponse.- Parameters:
context- The context to exposerequest- The request to exposeresponse- The response to expose- Returns:
- an initialized
Bindingsinstance.
-
bindings
public static Bindings bindings(String name, Object value)
- Parameters:
name- binding namevalue- binding value- Returns:
- an initialized
Bindingsinstance.
-
bind
public Bindings bind(String name, Object value)
Binds a newvalueto the givenname.- Parameters:
name- binding name (must not benull)value- binding value- Returns:
- this
Bindings
-
bind
public Bindings bind(Bindings source)
Binds all the bindings already bound fromsource.- Parameters:
source- current bindings to copy (must not benull)- Returns:
- this
Bindings
-
asMap
public Map<String,Object> asMap()
Returns an unmodifiableMapview of thisBindingsinstance.Note that while the consumer of the Map cannot modify it, any changes done through the Bindings methods will be reflected in the returned Map.
- Returns:
- an unmodifiable
Mapview of this instance (nevernull).
-
flatten
public static Map<String,Context> flatten(Context leaf)
Flatten the currentleafContextinto a Map keyed by context name.The Context hierarchy is walked from the given
leafto the root context, parent after parent.If a context's name has already been added into the Map while walking up the chain, the context will be ignored (shadowed by the previously registered context). That behaviour ensure that we'll return only the contexts that are close to the leaf.
- Parameters:
leaf- Context used to start the walk-through- Returns:
- a Map of context
- See Also:
Context.getContextName()
-
-