public final class DefaultXPathBinder extends Object implements XPathBinder
Constructor and Description |
---|
DefaultXPathBinder(XBProjector projector,
DocumentResolver documentProvider,
String xpath,
Closeable documentWriter)
Constructor for DefaultXPathEvaluator.
|
Modifier and Type | Method and Description |
---|---|
<T> CloseableValue<T> |
as(Class<T> returnType)
Evaluate the XPath as a value of the given type.
|
CloseableValue<Boolean> |
asBoolean()
Evaluates the XPath as a boolean value.
|
CloseableValue<Date> |
asDate()
Evaluates the XPath as a Date value.
|
CloseableValue<Integer> |
asInt()
Evaluates the XPath as a int value.
|
<T> CloseableList<T> |
asListOf(Class<T> componentType)
Evaluate the XPath as a list of the given type.
|
<T> CloseableMap<T> |
asMapOf(Class<T> valueType)
Evaluate the XPath as a map with the given value type.
|
CloseableValue<String> |
asString()
Evaluates the XPath as a String value.
|
static <T> void |
validateEvaluationType(Class<T> returnType) |
public DefaultXPathBinder(XBProjector projector, DocumentResolver documentProvider, String xpath, Closeable documentWriter)
projector
- documentProvider
- xpath
- documentWriter
- public CloseableValue<Boolean> asBoolean()
asBoolean
in interface XPathBinder
public CloseableValue<Integer> asInt()
asInt
in interface XPathBinder
public CloseableValue<String> asString()
asString
in interface XPathBinder
public CloseableValue<Date> asDate()
asDate
in interface XPathBinder
public <T> CloseableValue<T> as(Class<T> returnType)
as
in interface XPathBinder
returnType
- Possible values: primitive types (e.g. Short.Type), Projection interfaces, any
class with a String constructor or a String factory method, and org.w3c.Nodepublic static <T> void validateEvaluationType(Class<T> returnType)
public <T> CloseableList<T> asListOf(Class<T> componentType)
asListOf
in interface XPathBinder
componentType
- Possible values: primitive types (e.g. Short.Type), Projection interfaces, any
class with a String constructor or a String factory method, and org.w3c.Nodepublic <T> CloseableMap<T> asMapOf(Class<T> valueType)
XPathBinder
asMapOf
in interface XPathBinder
valueType
- XPathBinder.asMapOf(java.lang.Class)
Copyright © 2012-12-21-2022. All Rights Reserved.