Class JPConverter

    • Constructor Detail

      • JPConverter

        public JPConverter()
    • Method Detail

      • allocate

        public 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
        Parameters:
        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 unknown
        config - the Saxon Configuration
        Returns:
        a suitable converter
      • convert

        public abstract Sequence convert​(java.lang.Object object,
                                         XPathContext context)
                                  throws XPathException
        Convert a Java object to an equivalent XPath value
        Parameters:
        object - the java object to be converted
        context - the XPath dynamic evaluation context
        Returns:
        the XPath value resulting from the conversion
        Throws:
        XPathException - if the conversion is not possible or if it fails
      • getItemType

        public abstract ItemType getItemType()
        Get the item type of the XPath value that will result from the conversion
        Returns:
        the XPath item type
      • getCardinality

        public int getCardinality()
        Get the cardinality of the XPath value that will result from the conversion
        Returns:
        the cardinality of the result