public abstract class JPConverter
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
JPConverter() |
Modifier and Type | Method and Description |
---|---|
static JPConverter |
allocate(java.lang.Class javaClass,
Configuration config)
Allocate a Java-to-XPath converter for a given class of Java objects
|
java.lang.String |
compile(java.lang.String var,
CodeGeneratorService compiler)
Generate a Java expression (as text) that can be used to implement this conversion when compiling
a query
|
abstract ValueRepresentation |
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, 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)config
- the Saxon Configurationpublic abstract ValueRepresentation 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()
public java.lang.String compile(java.lang.String var, CodeGeneratorService compiler)
var
- the Java variable that will hold the Java value to be convertedcompiler
- provides callback services