public abstract class PJConverter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PJConverter.AnyURIValueToURI |
static class |
PJConverter.AnyURIValueToURL |
static class |
PJConverter.Atomic
Converter for use when the source object is an atomic value, but nothing more is known
statically.
|
static class |
PJConverter.BooleanValueToBoolean |
static class |
PJConverter.CalendarValueToCalendar |
static class |
PJConverter.CalendarValueToDate |
static class |
PJConverter.General
General-purpose converter when nothing more specific is available.
|
static class |
PJConverter.Identity |
static class |
PJConverter.IntegerValueToBigInteger |
static class |
PJConverter.IntegerValueToByte |
static class |
PJConverter.IntegerValueToChar |
static class |
PJConverter.IntegerValueToInt |
static class |
PJConverter.IntegerValueToLong |
static class |
PJConverter.IntegerValueToShort |
static class |
PJConverter.NumericValueToBigDecimal |
static class |
PJConverter.NumericValueToDouble |
static class |
PJConverter.NumericValueToFloat |
static class |
PJConverter.QualifiedNameValueToQName |
static class |
PJConverter.StringValueToChar |
static class |
PJConverter.StringValueToString |
static class |
PJConverter.ToArray
Converter for use when the target class is an array
|
static class |
PJConverter.ToCollection
Converter for use when the target class is a collection class.
|
static class |
PJConverter.ToNull |
static class |
PJConverter.ToOne
Converter for use when the target class is
One , which constrains the value to be
a singleton |
static class |
PJConverter.ToOneOrMore
Converter for use when the target class is
OneOrMore , which constrains the value to be
a non-empty sequence |
static class |
PJConverter.ToSequenceExtent |
static class |
PJConverter.ToSequenceIterator |
static class |
PJConverter.ToZeroOrMore
Converter for use when the target class is
ZeroOrMore , which allows any sequence
but is a generic (parameterized) class so there is compile-time information about the type
of items |
static class |
PJConverter.ToZeroOrOne
Converter for use when the target class is
ZeroOrOne , which constrains the value to be
a singleton or an empty sequence |
static class |
PJConverter.UnwrapExternalObject |
Constructor and Description |
---|
PJConverter() |
Modifier and Type | Method and Description |
---|---|
static PJConverter |
allocate(Configuration config,
ItemType itemType,
int cardinality,
java.lang.Class targetClass)
Factory method to instantiate a converter from a given XPath type to a given Java class
|
static PJConverter |
allocateNodeListCreator(Configuration config,
java.lang.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)
|
abstract java.lang.Object |
convert(Sequence value,
java.lang.Class targetClass,
XPathContext context)
Convert an XPath value to a Java value of a specified class
|
static SequenceType |
getEquivalentSequenceType(java.lang.Class javaClass)
Get the nearest XPath equivalent to a Java class.
|
static SequenceType |
getParameterizedSequenceType(java.lang.reflect.Type javaType)
Get the nearest XPath equivalent to a Java parameterized type.
|
public static SequenceType getEquivalentSequenceType(java.lang.Class javaClass)
javaClass
- a Java classpublic static SequenceType getParameterizedSequenceType(java.lang.reflect.Type javaType)
javaType
- a parameterized Java classpublic abstract java.lang.Object convert(Sequence value, java.lang.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 static PJConverter allocate(Configuration config, ItemType itemType, int cardinality, java.lang.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 resultXPathException
- if no conversion is possiblepublic static PJConverter allocateNodeListCreator(Configuration config, java.lang.Object node)
config
- the Saxon configurationnode
- an object representing a node in an external modelCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.