public abstract class PJConverter extends Object implements Serializable
| Constructor and Description |
|---|
PJConverter() |
| Modifier and Type | Method and Description |
|---|---|
static PJConverter |
allocate(Configuration config,
ItemType itemType,
int cardinality,
Class targetClass)
Factory method to instantiate a converter from a given XPath type to a given Java class
|
static PJConverter |
allocateNodeListCreator(Configuration config,
Object node)
Static method to get a converter from an XPath sequence of nodes to the representation of a NodeList
in an external object model (this is really a special for DOM, which uses NodeList rather than general
purpose Java collection classes)
|
String |
compile(String var,
Class targetClass,
CodeGeneratorService compiler)
Generate Java code to implement the type conversion
|
abstract Object |
convert(ValueRepresentation value,
Class targetClass,
XPathContext context)
Convert an XPath value to a Java value of a specified class
|
static SequenceType |
getEquivalentItemType(Class javaClass)
Get the nearest XPath equivalent to a Java class.
|
public static SequenceType getEquivalentItemType(Class javaClass)
javaClass - a Java classpublic abstract Object convert(ValueRepresentation value, Class targetClass, XPathContext context) throws XPathException
value - the supplied XPath valuetargetClass - the class of the required Java valuecontext - the XPath dynamic contextXPathException - if the conversion is not possible or failspublic String compile(String var, Class targetClass, CodeGeneratorService compiler)
var - the name of a variable whose value will be the XPath ValueRepresentation
to be convertedtargetClass - the required class of the Java valuecompiler - provides supporting services by callbackpublic static PJConverter allocate(Configuration config, ItemType itemType, int cardinality, Class targetClass) throws XPathException
config - the Saxon ConfigurationitemType - the item type of the XPath value to be convertedcardinality - the cardinality of the XPath value to be convertedtargetClass - the Java class required for the conversion resultXPathExceptionpublic static PJConverter allocateNodeListCreator(Configuration config, Object node)