@NotThreadSafe public class MapBasedXPathVariableResolverQName extends Object implements XPathVariableResolver, com.helger.commons.lang.ICloneable<MapBasedXPathVariableResolverQName>
XPathExpression to
resolve variable values used in XPath queries at runtime. The whole QName is
used as the key in the map. The namespace is not-ignored in this class.MapBasedXPathVariableResolver| Constructor and Description |
|---|
MapBasedXPathVariableResolverQName()
Default ctor.
|
MapBasedXPathVariableResolverQName(Map<QName,?> aVars)
Ctor taking another map.
|
MapBasedXPathVariableResolverQName(MapBasedXPathVariableResolverQName aOther)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
com.helger.commons.state.EChange |
addAllFrom(MapBasedXPathVariableResolver aOther,
boolean bOverwrite)
Add all variables from the other variable resolver into this resolver.
|
com.helger.commons.state.EChange |
addAllFrom(MapBasedXPathVariableResolverQName aOther,
boolean bOverwrite)
Add all variables from the other variable resolver into this resolver.
|
com.helger.commons.state.EChange |
addUniqueVariable(QName aName,
Object aValue)
Add a new variable.
|
com.helger.commons.state.EChange |
clear()
Remove all variables at once.
|
boolean |
equals(Object o) |
com.helger.commons.collection.impl.ICommonsMap<QName,?> |
getAllVariables() |
MapBasedXPathVariableResolverQName |
getClone() |
int |
getVariableCount() |
int |
hashCode() |
com.helger.commons.state.EChange |
removeVariable(QName aName)
Remove the variable with the specified name.
|
com.helger.commons.state.EChange |
removeVariables(Iterable<? extends QName> aNames)
Remove multiple variables at once.
|
Object |
resolveVariable(QName aVariableName) |
void |
setAllVariables(Map<QName,?> aVars)
Set multiple variables at once.
|
String |
toString() |
public MapBasedXPathVariableResolverQName()
public MapBasedXPathVariableResolverQName(@Nullable Map<QName,?> aVars)
aVars - Variables to re-use. May be null.public MapBasedXPathVariableResolverQName(@Nonnull MapBasedXPathVariableResolverQName aOther)
aOther - Object to copy data from@Nonnull public com.helger.commons.state.EChange addUniqueVariable(@Nonnull QName aName, @Nonnull Object aValue)
aName - The qualified name of the variableaValue - The value to be used.EChange@Nonnull public com.helger.commons.state.EChange addAllFrom(@Nonnull MapBasedXPathVariableResolverQName aOther, boolean bOverwrite)
aOther - The variable resolver to import the variable from. May not be
null.bOverwrite - if true existing variables will be overwritten with the
new variables, otherwise the old variables are kept.EChange@Nonnull public com.helger.commons.state.EChange addAllFrom(@Nonnull MapBasedXPathVariableResolver aOther, boolean bOverwrite)
aOther - The variable resolver to import the variable from. May not be
null.bOverwrite - if true existing variables will be overwritten with the
new variables, otherwise the old variables are kept.EChange@Nonnull public com.helger.commons.state.EChange removeVariable(@Nullable QName aName)
aName - The name to be removed. May be null.EChange@Nonnull public com.helger.commons.state.EChange removeVariables(@Nullable Iterable<? extends QName> aNames)
aNames - The names to be removed. May be null.EChange.CHANGED if at least one variable was removed.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsMap<QName,?> getAllVariables()
null
but maybe empty.@Nonnegative public int getVariableCount()
@Nonnull public com.helger.commons.state.EChange clear()
EChange.CHANGED if at least one variable was removed.public void setAllVariables(@Nullable Map<QName,?> aVars)
aVars - The variables to be set. May be null.@Nullable public Object resolveVariable(@Nonnull QName aVariableName)
resolveVariable in interface XPathVariableResolver@Nonnull @ReturnsMutableCopy public MapBasedXPathVariableResolverQName getClone()
getClone in interface com.helger.commons.lang.ICloneable<MapBasedXPathVariableResolverQName>Copyright © 2014–2020 Philip Helger. All rights reserved.