public class Bindings extends Object implements Lookup
Lookup.Util
Modifier and Type | Field and Description |
---|---|
protected Set<String> |
parameterNames |
protected URLforResource |
ufr |
protected Map<String,Object> |
vars |
Constructor and Description |
---|
Bindings() |
Bindings(Bindings initial) |
Bindings(Bindings bindings,
Set<String> parameterNames) |
Bindings(Bindings initial,
Set<String> parameterNames,
URLforResource ufr) |
Bindings(Bindings initial,
URLforResource ufr) |
Bindings(Set<String> parameterNames,
Bindings initial) |
Bindings(URLforResource ufr) |
Modifier and Type | Method and Description |
---|---|
Bindings |
copy()
Answer a copy of this ValValues.
|
Bindings |
copyWithDefaults(Bindings defaults)
Answer a copy of this Bindings with the given defaults.
|
static Bindings |
createContext(Bindings bindings,
MultiMap<String,String> queryParams)
Answer a new Bindings based on
bindings with additional
bindings from the query parameters. |
static String |
expandVariables(Lookup values,
String s)
Expands the string
s by replacing any occurrence of
{wossname} by the value of wossname as given by the Lookup
values . |
String |
expandVariables(String val) |
String |
expandVariables(String s,
List<String> seen) |
Value |
get(String name)
Answer the Value of the variable
name in this Bindings, or
null if it is not bound. |
Object |
getAny(String name)
Return whatever value is associated with the given
key ,
or null if there isn't one. |
String |
getAsString(String name,
String ifAbsent)
Answer the lexical form of the value of the variable
name ,
or the value of ifAbsent if it is not bound. |
String |
getValueString(String name)
Answer the lexical form of the value of the variable
name in
this Bindings, or null if it is not bound. |
Set<String> |
keySet()
Answer a set of the variable names bound in this ValValues.
|
Set<String> |
parameterNames()
Answer the set of parameter names (a subset of the variable names).
|
URL |
pathAsURL(String path)
Answer the URL for the resource named with the given partial path.
|
Bindings |
put(String name,
String valueString)
Bind
name to a LiteralNode which is a plain string with the
given valueString as its lexical form. |
Bindings |
put(String name,
Value v)
Bind
name to the value v . |
Bindings |
putAll(Bindings other)
Add all the entries from
other to this ValValues,
overwriting any existing bindings with the same names. |
Bindings |
putAny(String key,
Object value)
Associate the arbitrarry
value with the specified
key . |
boolean |
sameValuesAs(Bindings other)
Compare this binding with the other one, forcing evaluations along the
way.
|
String |
toString()
Answer a String which displays the content of this Bindings.
|
Bindings |
updateAll(Map<String,String> update)
Update all the entries in this Bindings to have the values that are
mentioned in update.
|
static Bindings |
uplift(Map<String,String> bindings)
Answer a new Bindings constructed from the given map by converting the
values into a string-valued Value.
|
protected final URLforResource ufr
public Bindings(Bindings initial, Set<String> parameterNames, URLforResource ufr)
public Bindings(Bindings initial, URLforResource ufr)
public Bindings(Bindings initial)
public Bindings(URLforResource ufr)
public Bindings()
public Bindings copyWithDefaults(Bindings defaults)
public Bindings copy()
public static Bindings createContext(Bindings bindings, MultiMap<String,String> queryParams)
bindings
with additional
bindings from the query parameters. Query parameters that do not
correspond to existing bindings are treated as plain literals.public Bindings putAll(Bindings other)
other
to this ValValues,
overwriting any existing bindings with the same names. Answer this
Bindings.public Bindings putAny(String key, Object value)
value
with the specified
key
. Return this Bindings.public Set<String> parameterNames()
public Value get(String name)
name
in this Bindings, or
null if it is not bound. If the value is not of type Value, convert it
to one if it's a String, and otherwise return null.public Object getAny(String name)
key
,
or null if there isn't one.public String getValueString(String name)
name
in
this Bindings, or null if it is not bound. Part of the implementation of
Lookup
.getValueString
in interface Lookup
public String getAsString(String name, String ifAbsent)
name
,
or the value of ifAbsent
if it is not bound.public Bindings put(String name, String valueString)
name
to a LiteralNode which is a plain string with the
given valueString
as its lexical form. Any existing binding
for name
is discarded. Answer this Bindings.public Bindings put(String name, Value v)
name
to the value v
. Discard any existing
binding for name
. Answer this Bindings.public URL pathAsURL(String path)
public String toString()
public boolean sameValuesAs(Bindings other)
public static String expandVariables(Lookup values, String s)
s
by replacing any occurrence of
{wossname} by the value of wossname as given by the Lookup
values
.public static Bindings uplift(Map<String,String> bindings)
Copyright © 2014. All Rights Reserved.