Package org.apache.juneau.marshall.jcs
Class JcsWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
JSON writer for JCS (RFC 8785) canonical output.
Extends JsonWriter with ECMAScript-compatible number serialization and JCS string
escaping (control characters, lone surrogate validation).
See Also:
-
Field Summary
Fields inherited from class org.apache.juneau.marshall.serializer.SerializerWriter
maxIndent, out, quoteChar, trimStrings, uriResolver, useWhitespace -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJcsWriter(Writer out, boolean useWhitespace, int maxIndent, boolean escapeSolidus, char quoteChar, boolean simpleAttrs, boolean trimStrings, UriResolver uriResolver) Constructor. -
Method Summary
Methods inherited from class org.apache.juneau.marshall.json.JsonWriter
attr, create, s, smi, uriValue
-
Constructor Details
-
JcsWriter
protected JcsWriter(Writer out, boolean useWhitespace, int maxIndent, boolean escapeSolidus, char quoteChar, boolean simpleAttrs, boolean trimStrings, UriResolver uriResolver) Constructor.- Parameters:
out- The writer being wrapped.useWhitespace- Iftrue , tabs and spaces will be used in output.maxIndent- The maximum indentation level.escapeSolidus- Iftrue , forward slashes should be escaped in the output.quoteChar- The quote character to use (always'"' for JCS).simpleAttrs- Iftrue , JSON attributes will only be quoted when necessary.trimStrings- Iftrue , strings will be trimmed before being serialized.uriResolver- The URI resolver for resolving URIs to absolute or root-relative form.
-
-
Method Details
-
append
Description copied from class:SerializerWriterWrites the string representation of the specified object to the writer.- Overrides:
appendin classSerializerWriter<JcsWriter>- Parameters:
value- The object to write.
Must not benull .- Returns:
- This object.
-
stringValue
Description copied from class:JsonWriterSerializes the specified object as a JSON string value.- Overrides:
stringValuein classJsonWriter<JcsWriter>- Parameters:
s- The object being serialized.
Can benull (nothing is written).- Returns:
- This object.
-