Class Bindings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasMap()Returns an unmodifiableMapview of thisBindingsinstance.Binds a newvalueto the givenname.Binds all the bindings already bound fromsource.static Bindingsbindings()Returns an emptyBindingsinstance (mutable).static Bindingsstatic BindingsReturns aBindingsinitialized with the givencontextandrequest.static BindingsReturns aBindingsinitialized with the givencontextandrequest.static BindingsReturns aBindingsinitialized with the givencontext,requestandresponse.Flatten the currentleafContextinto a Map keyed by context name.toString()
-
Constructor Details
-
Bindings
public Bindings()
-
-
Method Details
-
bindings
Returns an emptyBindingsinstance (mutable).- Returns:
- an empty
Bindingsinstance.
-
bindings
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
Returns aBindingsinitialized with the givencontextandrequest.- Parameters:
context- The context to exposerequest- The request to expose- Returns:
- an initialized
Bindingsinstance.
-
bindings
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
- Parameters:
name- binding namevalue- binding value- Returns:
- an initialized
Bindingsinstance.
-
bind
Binds a newvalueto the givenname.- Parameters:
name- binding name (must not benull)value- binding value- Returns:
- this
Bindings
-
bind
Binds all the bindings already bound fromsource.- Parameters:
source- current bindings to copy (must not benull)- Returns:
- this
Bindings
-
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
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:
-
toString
-