public final class UonWriter extends SerializerWriter
maxIndent, out, quoteChar, trimStrings, uriResolver, useWhitespace| Modifier | Constructor and Description |
|---|---|
protected |
UonWriter(UonSerializerSession session,
Writer out,
boolean useWhitespace,
int maxIndent,
boolean encodeChars,
boolean trimStrings,
boolean plainTextParams,
UriResolver uriResolver)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
UonWriter |
append(char c) |
UonWriter |
append(int indent,
char c)
Writes an indent (if the
useWhitespace setting is enabled), followed by text. |
UonWriter |
append(int indent,
String text)
Writes an indent (if the
useWhitespace setting is enabled), followed by text. |
UonWriter |
append(Object text)
Writes the specified text to the writer.
|
UonWriter |
append(String text)
Writes the specified text to the writer.
|
protected UonWriter |
appendBoolean(Object o)
Appends a boolean value to the output.
|
UonWriter |
appendIf(boolean b,
char c)
Writes the specified text to the writer if b is true.
|
UonWriter |
appendIf(boolean b,
String text)
Writes the specified text to the writer if b is true.
|
UonWriter |
appendln(int indent,
String text)
Writes an indent (if the
useWhitespace setting is enabled), followed by text, followed by a newline
(if the useWhitespace setting is enabled). |
UonWriter |
appendln(String text)
Writes the specified text followed by a newline (if the
useWhitespace setting is enabled). |
protected UonWriter |
appendNumber(Object o)
Appends a numeric value to the output.
|
UonWriter |
appendObject(Object o,
boolean isTopAttrName)
Serializes the specified simple object as a UON string value.
|
SerializerWriter |
appendUri(Object uri)
Appends a URI to the output.
|
UonWriter |
cr(int depth)
Performs a carriage return.
|
UonWriter |
cre(int depth)
Performs a carriage return at the end of a line.
|
UonWriter |
i(int indent)
Writes an indent to the writer if the
useWhitespace setting is enabled. |
UonWriter |
nl(int indent)
Writes a newline to the writer if the
useWhitespace setting is enabled. |
UonWriter |
q()
Adds the quote character specified by the
quoteChar setting to the output. |
protected UonWriter(UonSerializerSession session, Writer out, boolean useWhitespace, int maxIndent, boolean encodeChars, boolean trimStrings, boolean plainTextParams, UriResolver uriResolver)
session - The session that created this writer.out - The writer being wrapped.useWhitespace - If maxIndent - The maximum indentation level.encodeChars - If trimStrings - If plainTextParams - If uriResolver - The URI resolver for resolving URIs to absolute or root-relative form.public final UonWriter appendObject(Object o, boolean isTopAttrName) throws IOException
o - The object being serialized.isTopAttrName - If this is a top-level attribute name we're serializing.IOException - Should never happen.protected UonWriter appendBoolean(Object o) throws IOException
o - The boolean value to append to the output.IOException - Thrown by underlying stream.protected UonWriter appendNumber(Object o) throws IOException
o - The numeric value to append to the output.IOException - Thrown by underlying stream.public SerializerWriter appendUri(Object uri) throws IOException
appendUri in class SerializerWriteruri - The URI to append to the output.IOException - Thrown by underlying stream.public UonWriter cr(int depth) throws IOException
SerializerWriter
Adds a newline and the specified number of tabs (if the useWhitespace setting is enabled) to the output.
cr in class SerializerWriterdepth - The indentation.IOException - If a problem occurred trying to write to the writer.public UonWriter cre(int depth) throws IOException
SerializerWriter
Adds a newline and the specified number of tabs (if the useWhitespace setting is enabled) to the output.
cre in class SerializerWriterdepth - The indentation.IOException - If a problem occurred trying to write to the writer.public UonWriter appendln(int indent, String text) throws IOException
SerializerWriteruseWhitespace setting is enabled), followed by text, followed by a newline
(if the useWhitespace setting is enabled).appendln in class SerializerWriterindent - The number of tabs to indent.text - The text to write.IOException - If a problem occurred trying to write to the writer.public UonWriter appendln(String text) throws IOException
SerializerWriteruseWhitespace setting is enabled).appendln in class SerializerWritertext - The text to write.IOException - If a problem occurred trying to write to the writer.public UonWriter append(int indent, String text) throws IOException
SerializerWriteruseWhitespace setting is enabled), followed by text.append in class SerializerWriterindent - The number of tabs to indent.text - The text to write.IOException - If a problem occurred trying to write to the writer.public UonWriter append(int indent, char c) throws IOException
SerializerWriteruseWhitespace setting is enabled), followed by text.append in class SerializerWriterindent - The number of tabs to indent.c - The character to write.IOException - If a problem occurred trying to write to the writer.public UonWriter q() throws IOException
SerializerWriterquoteChar setting to the output.q in class SerializerWriterIOException - If a problem occurred trying to write to the writer.public UonWriter i(int indent) throws IOException
SerializerWriteruseWhitespace setting is enabled.i in class SerializerWriterindent - The number of tabs to indent.IOException - If a problem occurred trying to write to the writer.public UonWriter nl(int indent) throws IOException
SerializerWriteruseWhitespace setting is enabled.nl in class SerializerWriterindent - The current indentation level.IOException - If a problem occurred trying to write to the writer.public UonWriter append(Object text) throws IOException
SerializerWriterappend in class SerializerWritertext - The text to write.IOException - If a problem occurred trying to write to the writer.public UonWriter append(String text) throws IOException
SerializerWriterappend in class SerializerWritertext - The text to write.IOException - If a problem occurred trying to write to the writer.public UonWriter appendIf(boolean b, String text) throws IOException
SerializerWriterappendIf in class SerializerWriterb - Boolean flag.text - The text to write.IOException - If a problem occurred trying to write to the writer.public UonWriter appendIf(boolean b, char c) throws IOException
SerializerWriterappendIf in class SerializerWriterb - Boolean flag.c - The text to write.IOException - If a problem occurred trying to write to the writer.public UonWriter append(char c) throws IOException
append in interface Appendableappend in class SerializerWriterIOExceptionCopyright © 2016–2019 The Apache Software Foundation. All rights reserved.