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
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <RC, WC> XMLContent<RC,WC>
    Returns an empty content
    static <RC, WC> XMLContent<RC,WC>
    of(BiConsumer<RC,String> consumer)
    Returns XML content whose text is consumed by the specified consumer during parsing.
    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.
    static <RC, WC> XMLContent<RC,WC>
    of(XMLElementGroup<RC,WC> group)
    Returns an empty content
    void
    readContent(org.jboss.staxmapper.XMLExtendedStreamReader reader, RC context)
    Reads element content into the specified reader context.

    Methods inherited from interface org.jboss.as.controller.xml.XMLContentWriter

    andThen, compose, isEmpty, map

    Methods inherited from interface org.jboss.staxmapper.XMLElementWriter

    writeContent
  • Method Details

    • 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