- java.lang.Object
-
- io.github.mmm.marshall.AbstractStructuredWriter
-
- All Implemented Interfaces:
StructuredWriter
,AutoCloseable
- Direct Known Subclasses:
AbstractStructuredStringWriter
public abstract class AbstractStructuredWriter extends Object implements StructuredWriter
Abstract base implementation ofStructuredWriter
.
-
-
Field Summary
Fields Modifier and Type Field Description protected MarshallingConfig
config
TheMarshallingConfig
.protected String
indentation
protected String
name
The current name.protected boolean
writeNullValues
-
Constructor Summary
Constructors Constructor Description AbstractStructuredWriter(MarshallingConfig config)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
writeName(String newName)
Writes the name of a property.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mmm.marshall.StructuredWriter
close, writeEnd, writeStartArray, writeStartObject, writeValue, writeValueAsBigDecimal, writeValueAsBigInteger, writeValueAsBoolean, writeValueAsByte, writeValueAsDouble, writeValueAsFloat, writeValueAsInteger, writeValueAsLong, writeValueAsNull, writeValueAsNumber, writeValueAsShort, writeValueAsString
-
-
-
-
Field Detail
-
config
protected final MarshallingConfig config
TheMarshallingConfig
.
-
writeNullValues
protected final boolean writeNullValues
- See Also:
StructuredWriter.writeValueAsNull()
-
indentation
protected final String indentation
- See Also:
MarshallingConfig.INDENTATION
-
name
protected String name
The current name.- See Also:
writeName(String)
-
-
Constructor Detail
-
AbstractStructuredWriter
public AbstractStructuredWriter(MarshallingConfig config)
The constructor.- Parameters:
config
- theMarshallingConfig
.
-
-
Method Detail
-
writeName
public void writeName(String newName)
Description copied from interface:StructuredWriter
Writes the name of a property. After the call of this method a subsequent call ofStructuredWriter.writeStartArray()
,StructuredWriter.writeStartObject()
orStructuredWriter.writeValue(Object)
(including any of its typed variants) needs to be called.- Specified by:
writeName
in interfaceStructuredWriter
-
-