Class XmlConfigurationWriter

java.lang.Object
org.infinispan.commons.configuration.io.AbstractConfigurationWriter
org.infinispan.commons.configuration.io.xml.XmlConfigurationWriter
All Implemented Interfaces:
AutoCloseable, ConfigurationWriter

public class XmlConfigurationWriter extends AbstractConfigurationWriter
Since:
12.1
Author:
Tristan Tarrant <tristan@infinispan.org>
  • Constructor Details

    • XmlConfigurationWriter

      public XmlConfigurationWriter(Writer writer, boolean prettyPrint, boolean clearTextSecrets)
  • Method Details

    • getVersion

      public String getVersion()
    • setVersion

      public void setVersion(String version)
    • getEncoding

      public String getEncoding()
    • setEncoding

      public void setEncoding(String encoding)
    • getStandalone

      public Optional<Boolean> getStandalone()
    • setStandalone

      public void setStandalone(Optional<Boolean> standalone)
    • writeStartDocument

      public void writeStartDocument()
    • writeStartElement

      public void writeStartElement(String name)
    • writeStartElement

      public void writeStartElement(String prefix, String namespace, String name)
    • writeStartArrayElement

      public void writeStartArrayElement(String name)
      Description copied from interface: ConfigurationWriter
      Writes an array element. This will be treated as follows by the various implementations:
      • XML <outer></outer>
      • YAML
               name:
        - item1 - item2
      • JSON name: [ item1, item2 ]
      Parameters:
      name -
    • writeEndArrayElement

      public void writeEndArrayElement()
    • writeStartListElement

      public void writeStartListElement(String name, boolean explicit)
      Description copied from interface: ConfigurationWriter
      Starts a list element.
      Parameters:
      name -
      explicit -
    • writeStartListElement

      public void writeStartListElement(String prefix, String namespace, String name, boolean explicit)
    • writeEndListElement

      public void writeEndListElement()
      Specified by:
      writeEndListElement in interface ConfigurationWriter
      Overrides:
      writeEndListElement in class AbstractConfigurationWriter
    • writeNamespace

      public void writeNamespace(String prefix, String namespace)
    • writeDefaultNamespace

      public void writeDefaultNamespace(String namespace)
    • writeEndElement

      public void writeEndElement()
    • writeEndDocument

      public void writeEndDocument()
    • writeAttribute

      public void writeAttribute(String name, String value)
    • writeAttribute

      public void writeAttribute(String name, Iterable<String> values)
    • writeArrayElement

      public void writeArrayElement(String outer, String inner, String attribute, Iterable<String> values)
    • writeCharacters

      public void writeCharacters(String chars)
    • writeEmptyElement

      public void writeEmptyElement(String name)
    • writeStartMap

      public void writeStartMap(String name)
    • writeMapItem

      public void writeMapItem(String element, String name, String key, String value)
      Description copied from interface: ConfigurationWriter
      Writes a simple map entry.
      • XML: <element name="key">value<element>
      • JSON: { key: value }
      • YAML: key: value

      The key name is not translated by the underlying serialization implementation and is used as is

      Parameters:
      element - Used only by XML
      name - Used only by XML
      key -
      value -
    • writeMapItem

      public void writeMapItem(String element, String name, String key)
      Description copied from interface: ConfigurationWriter
      Writes a complex map entry.
      • XML: <element name="key">...<element>
      • JSON: { key: { ... } }
      • YAML: key:

      The key name is not translated by the underlying serialization implementation and is used as is

      Parameters:
      element - Used only by XML
      name - Used only by XML
      key -
    • writeEndMapItem

      public void writeEndMapItem()
    • writeEndMap

      public void writeEndMap()
    • writeComment

      public void writeComment(String comment)
    • hasFeature

      public boolean hasFeature(ConfigurationFormatFeature feature)