Interface XMLContent<RC,​WC>

  • Type Parameters:
    RC - the reader context
    WC - the writer content
    All Superinterfaces:
    XMLContentWriter<WC>, org.jboss.staxmapper.XMLElementWriter<WC>
    All Known Implementing Classes:
    XMLContent.DefaultXMLContent

    public interface XMLContent<RC,​WC>
    extends XMLContentWriter<WC>
    Encapsulates the content of an XML element.
    Author:
    Paul Ferraro
    • Method Detail

      • readContent

        void readContent​(org.jboss.staxmapper.XMLExtendedStreamReader reader,
                         RC context)
                  throws XMLStreamException
        Reads element content into the specified reader context.
        Parameters:
        reader - a StaX reader
        context - the reader context
        Throws:
        XMLStreamException - if the input could not be read from the specified reader.
      • empty

        static <RC,​WC> XMLContent<RC,​WC> empty()
        Returns an empty content
        Type Parameters:
        RC - the reader context
        WC - the writer context
        Returns:
        an empty content
      • of

        static <RC,​WC> XMLContent<RC,​WC> of​(BiConsumer<RC,​String> consumer)
        Returns XML content whose text is consumed by the specified consumer during parsing.
        Type Parameters:
        RC - the read context type
        RC - the write context type
        Parameters:
        consumer - a consumer of text content
        Returns:
        XML content whose text is consumed by the specified consumer.
      • of

        static <RC,​WC> XMLContent<RC,​WC> of​(BiConsumer<RC,​String> consumer,
                                                        Function<WC,​String> formatter)
        Returns XML content whose text is consumed by the specified consumer during parsing and formatted using the specified function during marshalling.
        Type Parameters:
        RC - the read context type
        RC - the write context type
        Parameters:
        consumer - a consumer of text content
        formatter - a formatter of text content
        Returns:
        XML content whose text is consumed by the specified consumer.
      • of

        static <RC,​WC> XMLContent<RC,​WC> of​(XMLElementGroup<RC,​WC> group)
        Returns an empty content
        Type Parameters:
        RC - the reader context
        WC - the writer context
        Returns:
        an empty content