Interface XMLContentWriter<C>

Type Parameters:
C - the writer context.
All Superinterfaces:
org.jboss.staxmapper.XMLElementWriter<C>
All Known Subinterfaces:
XMLContent<RC,WC>
All Known Implementing Classes:
NamedResourceRegistrationXMLElement.ResourcePropertyAttributesXMLContentWriter, ResourceRegistrationXMLElement.ResourcePropertyAttributesXMLContentWriter, ResourceXMLContainer.ResourceAttributesXMLContentWriter, XMLContent.DefaultXMLContent, XMLElement.DefaultXMLElementWriter

public interface XMLContentWriter<C> extends org.jboss.staxmapper.XMLElementWriter<C>
Adds empty content detection to an XMLElementWriter.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a new writer that invokes XMLElementWriter.writeContent(XMLExtendedStreamWriter, Object) on the specified writer after invoking XMLElementWriter.writeContent(XMLExtendedStreamWriter, Object) on this writer.
    Returns a new writer that invokes XMLElementWriter.writeContent(XMLExtendedStreamWriter, Object) on the specified writer before invoking XMLElementWriter.writeContent(XMLExtendedStreamWriter, Object) on this writer.
    static <RC, WC> XMLContentWriter<WC>
    composite(Collection<? extends XMLComponent<RC,WC>> components)
     
    static <C> XMLContentWriter<C>
    Returns an empty content writer.
    boolean
    isEmpty(C content)
    Indicates whether the specified content is empty.
    default <T> XMLContentWriter<T>
    map(Function<T,C> mapper)
    Returns a new writer whose content is mapped from the specified function.

    Methods inherited from interface org.jboss.staxmapper.XMLElementWriter

    writeContent
  • Method Details

    • isEmpty

      boolean isEmpty(C content)
      Indicates whether the specified content is empty.
    • map

      default <T> XMLContentWriter<T> map(Function<T,C> mapper)
      Returns a new writer whose content is mapped from the specified function.
      Type Parameters:
      T - the mapped content type
      Parameters:
      mapper - a content mapping function
      Returns:
      a new writer whose content is mapped from the specified function.
    • andThen

      default XMLContentWriter<C> andThen(XMLContentWriter<C> after)
      Returns a new writer that invokes XMLElementWriter.writeContent(XMLExtendedStreamWriter, Object) on the specified writer after invoking XMLElementWriter.writeContent(XMLExtendedStreamWriter, Object) on this writer.
      Parameters:
      writer - a content writer
      Returns:
      a new content writer combining this writer with the specified writer
    • compose

      default XMLContentWriter<C> compose(XMLContentWriter<C> before)
      Returns a new writer that invokes XMLElementWriter.writeContent(XMLExtendedStreamWriter, Object) on the specified writer before invoking XMLElementWriter.writeContent(XMLExtendedStreamWriter, Object) on this writer.
      Parameters:
      writer - a content writer
      Returns:
      a new content writer combining this writer with the specified writer
    • empty

      static <C> XMLContentWriter<C> empty()
      Returns an empty content writer.
      Type Parameters:
      C - the writer context.
      Returns:
      an empty content writer.
    • composite

      static <RC, WC> XMLContentWriter<WC> composite(Collection<? extends XMLComponent<RC,WC>> components)