Class AbstractConfigurationWriter
- java.lang.Object
-
- org.infinispan.commons.configuration.io.AbstractConfigurationWriter
-
- All Implemented Interfaces:
AutoCloseable
,ConfigurationWriter
- Direct Known Subclasses:
JsonConfigurationWriter
,XmlConfigurationWriter
,YamlConfigurationWriter
public abstract class AbstractConfigurationWriter extends Object implements ConfigurationWriter
- Since:
- 12.1
- Author:
- Tristan Tarrant <[email protected]>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractConfigurationWriter.Tag
-
Nested classes/interfaces inherited from interface org.infinispan.commons.configuration.io.ConfigurationWriter
ConfigurationWriter.Builder
-
-
Field Summary
Fields Modifier and Type Field Description protected int
currentIndent
protected Map<String,String>
namespaces
protected NamingStrategy
naming
protected Deque<AbstractConfigurationWriter.Tag>
tagStack
protected Writer
writer
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractConfigurationWriter(Writer writer, int indent, boolean prettyPrint, NamingStrategy naming)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected void
indent()
protected void
nl()
protected void
outdent()
void
writeAttribute(Enum<?> name, String value)
void
writeEmptyElement(Enum<?> name)
void
writeEndListElement()
protected void
writeIndent()
void
writeStartElement(Enum<?> name)
void
writeStartElement(String prefix, String namespace, Enum<?> name)
void
writeStartListElement(Enum<?> name, boolean explicit)
void
writeStartListElement(String prefix, String namespace, Enum<?> name, boolean explicit)
void
writeStartMapElement(Enum<?> name)
void
writeStartMapEntry(Enum<?> name, Enum<?> key, String value)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.commons.configuration.io.ConfigurationWriter
writeAttribute, writeCharacters, writeComment, writeDefaultNamespace, writeEmptyElement, writeEndDocument, writeEndElement, writeEndMapElement, writeNamespace, writeStartDocument, writeStartElement, writeStartElement, writeStartListElement, writeStartListElement, writeStartMapElement, writeStartMapEntry
-
-
-
-
Field Detail
-
writer
protected final Writer writer
-
tagStack
protected final Deque<AbstractConfigurationWriter.Tag> tagStack
-
currentIndent
protected int currentIndent
-
naming
protected final NamingStrategy naming
-
-
Constructor Detail
-
AbstractConfigurationWriter
protected AbstractConfigurationWriter(Writer writer, int indent, boolean prettyPrint, NamingStrategy naming)
-
-
Method Detail
-
writeStartElement
public void writeStartElement(Enum<?> name)
- Specified by:
writeStartElement
in interfaceConfigurationWriter
-
writeStartElement
public void writeStartElement(String prefix, String namespace, Enum<?> name)
- Specified by:
writeStartElement
in interfaceConfigurationWriter
-
writeStartListElement
public void writeStartListElement(Enum<?> name, boolean explicit)
- Specified by:
writeStartListElement
in interfaceConfigurationWriter
-
writeStartListElement
public void writeStartListElement(String prefix, String namespace, Enum<?> name, boolean explicit)
- Specified by:
writeStartListElement
in interfaceConfigurationWriter
-
writeEndListElement
public void writeEndListElement()
- Specified by:
writeEndListElement
in interfaceConfigurationWriter
-
writeStartMapElement
public void writeStartMapElement(Enum<?> name)
- Specified by:
writeStartMapElement
in interfaceConfigurationWriter
-
writeStartMapEntry
public void writeStartMapEntry(Enum<?> name, Enum<?> key, String value)
- Specified by:
writeStartMapEntry
in interfaceConfigurationWriter
-
writeAttribute
public void writeAttribute(Enum<?> name, String value)
- Specified by:
writeAttribute
in interfaceConfigurationWriter
-
writeEmptyElement
public void writeEmptyElement(Enum<?> name)
- Specified by:
writeEmptyElement
in interfaceConfigurationWriter
-
nl
protected void nl() throws IOException
- Throws:
IOException
-
writeIndent
protected void writeIndent() throws IOException
- Throws:
IOException
-
indent
protected void indent()
-
outdent
protected void outdent()
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-