Interface Transducer<ValueT>

    • Method Detail

      • print

        @NotNull
        java.lang.CharSequence print​(@NotNull
                                     ValueT o)
                              throws AccessorException
        Converts the given value to its lexical representation.
        Parameters:
        o - never be null.
        Returns:
        always non-null valid lexical representation.
        Throws:
        AccessorException
      • parse

        ValueT parse​(java.lang.CharSequence lexical)
              throws AccessorException,
                     org.xml.sax.SAXException
        Converts the lexical representation to a value object.
        Parameters:
        lexical - never be null.
        Throws:
        AccessorException - if the transducer is used to parse an user bean that uses XmlValue, then this exception may occur when it tries to set the leaf value to the bean.
        org.xml.sax.SAXException - if the lexical form is incorrect, the error should be reported and SAXException may thrown (or it can return null to recover.)
      • getTypeName

        javax.xml.namespace.QName getTypeName​(@NotNull
                                              ValueT instance)
        Transducers implicitly work against a single XML type, but sometimes (most notably XMLGregorianCalendar, an instance may choose different XML types.
        Returns:
        return non-null from this method allows transducers to specify the type it wants to marshal to. Most of the time this method returns null, in which case the implicitly associated type will be used.