Class TransducedAccessor<BeanT>

    • Constructor Detail

      • TransducedAccessor

        public TransducedAccessor()
    • Method Detail

      • print

        @Nullable
        public abstract java.lang.CharSequence print​(@NotNull
                                                     BeanT o)
                                              throws AccessorException,
                                                     org.xml.sax.SAXException
        Prints the responsible field of the given bean to the writer.

        Use XMLSerializer.getInstance() to access to the namespace bindings

        Returns:
        if the accessor didn't yield a value, return null.
        Throws:
        AccessorException
        org.xml.sax.SAXException
      • parse

        public abstract void parse​(BeanT o,
                                   java.lang.CharSequence lexical)
                            throws AccessorException,
                                   org.xml.sax.SAXException
        Parses the text value into the responsible field of the given bean.

        Use UnmarshallingContext.getInstance() to access to the namespace bindings

        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.
        java.lang.RuntimeException - if the lexical form is incorrect. The method may throw a RuntimeException, but it shouldn't cause the entire unmarshalling to fail.
        org.xml.sax.SAXException - if the parse method found an error, the error is reported, and then the processing is aborted.
      • writeLeafElement

        public abstract void writeLeafElement​(XMLSerializer w,
                                              Name tagName,
                                              BeanT o,
                                              java.lang.String fieldName)
                                       throws org.xml.sax.SAXException,
                                              AccessorException,
                                              java.io.IOException,
                                              javax.xml.stream.XMLStreamException
        Convenience method to write the value as a text inside an element without any attributes. Can be overridden for improved performance.

        The callee assumes that there's an associated value in the field. No @xsi:type handling is expected.

        Throws:
        org.xml.sax.SAXException
        AccessorException
        java.io.IOException
        javax.xml.stream.XMLStreamException
      • writeText

        public abstract void writeText​(XMLSerializer w,
                                       BeanT o,
                                       java.lang.String fieldName)
                                throws AccessorException,
                                       org.xml.sax.SAXException,
                                       java.io.IOException,
                                       javax.xml.stream.XMLStreamException
        Invokes one of the XMLSerializer.text(String, String) method with the representation of data bested suited for this transduced accessor.
        Throws:
        AccessorException
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.stream.XMLStreamException