public abstract class JPConverter
extends java.lang.Object
The general principle is to allocate a specific JPConverter at compile time wherever possible. If there is insufficient type information to make this feasible, a general-purpose JPConverter is allocated, which in turn allocates a more specific converter at run-time to do the actual work.
| Constructor and Description |
|---|
JPConverter() |
| Modifier and Type | Method and Description |
|---|---|
static JPConverter |
allocate(java.lang.Class javaClass,
java.lang.reflect.Type genericType,
Configuration config)
Allocate a Java-to-XPath converter for a given class of Java objects
|
abstract Sequence<?> |
convert(java.lang.Object object,
XPathContext context)
Convert a Java object to an equivalent XPath value
|
int |
getCardinality()
Get the cardinality of the XPath value that will result from the conversion
|
abstract ItemType |
getItemType()
Get the item type of the XPath value that will result from the conversion
|
public static JPConverter allocate(java.lang.Class javaClass, java.lang.reflect.Type genericType, Configuration config)
javaClass - the class of the Java object to be converted (this may be the static type
or the dynamic type, depending when the converter is allocated)genericType - the generic type of the Java object; may be null if unknownconfig - the Saxon Configuration @return a suitable converterpublic abstract Sequence<?> convert(java.lang.Object object, XPathContext context) throws XPathException
object - the java object to be convertedcontext - the XPath dynamic evaluation contextXPathException - if the conversion is not possible or if it failspublic abstract ItemType getItemType()
public int getCardinality()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.