@NotThreadSafe public class MapBasedXPathFunctionResolver extends Object implements XPathFunctionResolver, com.helger.commons.lang.ICloneable<MapBasedXPathFunctionResolver>
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.| Constructor and Description |
|---|
MapBasedXPathFunctionResolver()
Default ctor.
|
MapBasedXPathFunctionResolver(MapBasedXPathFunctionResolver aOther)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
com.helger.commons.state.EChange |
addAllFrom(MapBasedXPathFunctionResolver aOther,
boolean bOverwrite)
Add all functions from the other function resolver into this resolver.
|
com.helger.commons.state.EChange |
addUniqueFunction(QName aName,
int nArity,
XPathFunction aFunction)
Add a new function.
|
com.helger.commons.state.EChange |
addUniqueFunction(String sNamespaceURI,
String sLocalPart,
int nArity,
XPathFunction aFunction)
Add a new function.
|
com.helger.commons.state.EChange |
clear()
Remove all functions at once.
|
boolean |
equals(Object o) |
com.helger.commons.collection.impl.ICommonsOrderedMap<XPathFunctionKey,XPathFunction> |
getAllFunctions() |
MapBasedXPathFunctionResolver |
getClone() |
int |
getFunctionCount() |
int |
hashCode() |
com.helger.commons.state.EChange |
removeFunction(QName aName,
int nArity)
Remove the function with the specified name.
|
com.helger.commons.state.EChange |
removeFunction(XPathFunctionKey aKey)
Remove the function with the specified name.
|
com.helger.commons.state.EChange |
removeFunctionsWithName(QName aName)
Remove all functions with the same name.
|
XPathFunction |
resolveFunction(QName aFunctionName,
int nArity) |
XPathFunction |
resolveFunction(XPathFunctionKey aFunctionKey) |
String |
toString() |
public MapBasedXPathFunctionResolver()
public MapBasedXPathFunctionResolver(@Nonnull MapBasedXPathFunctionResolver aOther)
aOther - Object to copy data from@Nonnull public com.helger.commons.state.EChange addUniqueFunction(@Nonnull String sNamespaceURI, @Nonnull String sLocalPart, @Nonnegative int nArity, @Nonnull XPathFunction aFunction)
sNamespaceURI - The namespace URI of the functionsLocalPart - The local part of the functionnArity - The number of parameters of the functionaFunction - The function to be used. May not be null.EChange@Nonnull public com.helger.commons.state.EChange addUniqueFunction(@Nonnull QName aName, @Nonnegative int nArity, @Nonnull XPathFunction aFunction)
aName - The qualified name of the functionnArity - The number of parameters of the functionaFunction - The function to be used. May not be null.EChange@Nonnull public com.helger.commons.state.EChange addAllFrom(@Nonnull MapBasedXPathFunctionResolver aOther, boolean bOverwrite)
aOther - The function resolver to import the functions from. May not be
null.bOverwrite - if true existing functions will be overwritten with the
new functions, otherwise the old functions are kept.EChange@Nonnull public com.helger.commons.state.EChange removeFunction(@Nonnull QName aName, @Nonnegative int nArity)
aName - The name to be removed. May not be null.nArity - The number of parameters of the function. Must be ≥ 0.EChange@Nonnull public com.helger.commons.state.EChange removeFunction(@Nullable XPathFunctionKey aKey)
aKey - The function key to be removed. May be null.EChange@Nonnull public com.helger.commons.state.EChange removeFunctionsWithName(@Nullable QName aName)
aName - The name to be removed. May be null.EChange.CHANGED if at least one function was removed.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedMap<XPathFunctionKey,XPathFunction> getAllFunctions()
null
but maybe empty.@Nonnegative public int getFunctionCount()
@Nonnull public com.helger.commons.state.EChange clear()
EChange.CHANGED if at least one function was removed.@Nullable public XPathFunction resolveFunction(@Nonnull QName aFunctionName, @Nonnegative int nArity)
resolveFunction in interface XPathFunctionResolver@Nullable public XPathFunction resolveFunction(@Nullable XPathFunctionKey aFunctionKey)
@Nonnull @ReturnsMutableCopy public MapBasedXPathFunctionResolver getClone()
getClone in interface com.helger.commons.lang.ICloneable<MapBasedXPathFunctionResolver>Copyright © 2014–2023 Philip Helger. All rights reserved.