Package org.apache.juneau.marshall.uon
Class UonWriter
java.lang.Object
java.io.Writer
org.apache.juneau.marshall.serializer.SerializerWriter<UonWriter>
org.apache.juneau.marshall.uon.UonWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
Specialized writer for serializing UON-encoded text.
Notes:
- This class is not intended for external use.
See Also:
-
Field Summary
Fields inherited from class org.apache.juneau.marshall.serializer.SerializerWriter
maxIndent, out, quoteChar, trimStrings, uriResolver, useWhitespace -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUonWriter(UonSerializerSession session, Writer out, boolean useWhitespace, int maxIndent, boolean encodeChars, boolean trimStrings, boolean plainTextParams, char quoteChar, UriResolver uriResolver) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected UonWriterAppends a boolean value to the output.protected UonWriterAppends a numeric value to the output.appendObject(Object o, boolean isTopAttrName) Serializes the specified simple object as a UON string value.Appends a URI to the output.
-
Constructor Details
-
UonWriter
protected UonWriter(UonSerializerSession session, Writer out, boolean useWhitespace, int maxIndent, boolean encodeChars, boolean trimStrings, boolean plainTextParams, char quoteChar, UriResolver uriResolver) Constructor.- Parameters:
session- The session that created this writer.out- The writer being wrapped.useWhitespace- Iftrue , tabs will be used in output.maxIndent- The maximum indentation level.encodeChars- Iftrue , special characters should be encoded.trimStrings- Iftrue , strings should be trimmed before they're serialized.plainTextParams- Iftrue , don't use UON notation for values.quoteChar- The quote character to use. If0 , defaults to'\'' .uriResolver- The URI resolver for resolving URIs to absolute or root-relative form.
-
-
Method Details
-
appendObject
Serializes the specified simple object as a UON string value.- Parameters:
o- The object being serialized.
Can benull (emitted as the literal"null" ).isTopAttrName- If this is a top-level attribute name we're serializing.- Returns:
- This object.
-
appendUri
Appends a URI to the output.- Overrides:
appendUriin classSerializerWriter<UonWriter>- Parameters:
uri- The URI to append to the output.- Returns:
- This object.
-
appendBoolean
Appends a boolean value to the output.- Parameters:
o- The boolean value to append to the output.- Returns:
- This object.
-
appendNumber
Appends a numeric value to the output.- Parameters:
o- The numeric value to append to the output.- Returns:
- This object.
-