- All Implemented Interfaces:
Encode,JavaScript,Json,LdJson,Text,Url,ValidMediaFilter,ValidMediaInput,ValidMediaOutput,Whitespace,NoClose,Closeable,Flushable,Appendable,AutoCloseable
- Direct Known Subclasses:
LdJsonWriter
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
Fields inherited from class com.aoapps.encoding.MediaWriter
DEFAULT_CLOSER, DEFAULT_IS_NO_CLOSEFields inherited from class java.io.FilterWriter
outFields inherited from interface com.aoapps.encoding.Whitespace
INDENT_SPACES, NL, SPACE -
Constructor Summary
ConstructorsConstructorDescriptionJsonWriter(EncodingContext encodingContext, MediaEncoder encoder, Writer out) Simplified constructor.JsonWriter(EncodingContext encodingContext, MediaEncoder encoder, Writer out, boolean outOptimized, Whitespace indentDelegate, Predicate<? super MediaWriter> isNoClose, IOConsumer<? super MediaWriter> closer) -
Method Summary
Modifier and TypeMethodDescriptionappend(char c) append(CharSequence csq) append(CharSequence csq, int start, int end) decDepth()Decrements the indentation depth, if enabled.Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.<Ex extends Throwable>
JsonWriterencode(MediaType contentType, MediaWritable<Ex> content) Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.<Ex extends Throwable>
JsonWriterencode(MediaType contentType, IOSupplierE<?, Ex> content) Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.encode(MediaType contentType, CharSequence csq) Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.encode(MediaType contentType, CharSequence csq, int start, int end) Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Gets the input type.incDepth()Increments the indentation depth, if enabled.indent()Writes the current indentation when indentation enabled.indent(int depthOffset) Writes the current indentation with a depth offset when indentation enabled.Deprecated.Already writing JSON object graphjavascript(char ch) Deprecated.Already writing JSON object graphjavascript(char[] cbuf) Deprecated.Already writing JSON object graphjavascript(char[] cbuf, int offset, int len) Deprecated.Already writing JSON object graph<Ex extends Throwable>
JsonWriterjavascript(JavaScriptWritable<Ex> javascript) Deprecated.Already writing JSON object graph<Ex extends Throwable>
JsonWriterjavascript(IOSupplierE<?, Ex> javascript) Deprecated.Already writing JSON object graphjavascript(CharSequence csq) Deprecated.Already writing JSON object graphjavascript(CharSequence csq, int start, int end) Deprecated.Already writing JSON object graphjavascript(Object javascript) Deprecated.Already writing JSON object graphjson()Deprecated.Already writing JSON object graphjson(char ch) Deprecated.Already writing JSON object graphjson(char[] cbuf) Deprecated.Already writing JSON object graphjson(char[] cbuf, int offset, int len) Deprecated.Already writing JSON object graph<Ex extends Throwable>
JsonWriterjson(JsonWritable<Ex> json) Deprecated.Already writing JSON object graph<Ex extends Throwable>
JsonWriterjson(IOSupplierE<?, Ex> json) Deprecated.Already writing JSON object graphjson(CharSequence csq) Deprecated.Already writing JSON object graphjson(CharSequence csq, int start, int end) Deprecated.Already writing JSON object graphDeprecated.Already writing JSON object graphldJson()Deprecated.Already writing JSON object graphldJson(char ch) Deprecated.Already writing JSON object graphldJson(char[] cbuf) Deprecated.Already writing JSON object graphldJson(char[] cbuf, int offset, int len) Deprecated.Already writing JSON object graph<Ex extends Throwable>
JsonWriterldJson(LdJsonWritable<Ex> ldJson) Deprecated.Already writing JSON object graph<Ex extends Throwable>
JsonWriterldJson(IOSupplierE<?, Ex> ldJson) Deprecated.Already writing JSON object graphldJson(CharSequence csq) Deprecated.Already writing JSON object graphldJson(CharSequence csq, int start, int end) Deprecated.Already writing JSON object graphDeprecated.Already writing JSON object graphnbsp()Writes one non-breaking space character.nbsp(int count) Writes the given number of non-breaking space characters.nl()Writes a newline.nli()Writes a newline, followed by current indentation when indentation enabled.nli(int depthOffset) Writes a newline, followed by current indentation with a depth offset when indentation enabled.setDepth(int depth) Sets the indentation depth.setIndent(boolean indent) Enables or disabled indentation.sp()Writes one space character.sp(int count) Writes the given number of space characters.text(char ch) Writes the given text with proper encoding.text(char[] cbuf) Writes the given text with proper encoding.text(char[] cbuf, int offset, int len) Writes the given text with proper encoding.<Ex extends Throwable>
JsonWritertext(TextWritable<Ex> text) Writes the given text with proper encoding.<Ex extends Throwable>
JsonWritertext(IOSupplierE<?, Ex> text) Writes the given text with proper encoding.text(CharSequence csq) Writes the given text with proper encoding.text(CharSequence csq, int start, int end) Writes the given text with proper encoding.Writes the given text with proper encoding.url(char ch) Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.url(char[] cbuf) Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.url(char[] cbuf, int offset, int len) Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.<Ex extends Throwable>
JsonWriterurl(UrlWritable<Ex> url) Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.<Ex extends Throwable>
JsonWriterurl(IOSupplierE<?, Ex> url) Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.url(CharSequence csq) Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.url(CharSequence csq, int start, int end) Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.Methods inherited from class com.aoapps.encoding.WhitespaceWriter
getDepth, getIndentMethods inherited from class com.aoapps.encoding.MediaWriter
canSkipValidation, close, getEncoder, getEncodingContext, getValidMediaOutputType, isNoClose, isValidatingMediaInputTypeMethods inherited from class com.aoapps.lang.io.EncoderWriter
getOut, write, write, write, write, write, writePrefix, writeSuffix, writeSuffixMethods inherited from class java.io.FilterWriter
flushMethods inherited from class java.io.Writer
nullWriter
-
Constructor Details
-
JsonWriter
public JsonWriter(EncodingContext encodingContext, MediaEncoder encoder, Writer out, boolean outOptimized, Whitespace indentDelegate, Predicate<? super MediaWriter> isNoClose, IOConsumer<? super MediaWriter> closer) - Parameters:
out- Conditionally passed throughCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)outOptimized- Isoutalready known to have been passed throughCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)?indentDelegate- When non-null, indentation depth is get/set on the providedWhitespace, otherwise tracks directly on this writer. This allows the indentation to be coordinated between nested content types.isNoClose- Called to determine result ofMediaWriter.isNoClose()closer- Called onMediaWriter.close(), which may optionally perform final suffix write and/or close the underlying writer, will only be called to be idempotent, implementation can assume will only be called once.
-
JsonWriter
Simplified constructor.- Parameters:
out- Passed throughCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)- See Also:
-
-
Method Details
-
getValidMediaInputType
Description copied from class:MediaWriterGets the input type.Gets the media type this specific type of media writer represents. This is a one-to-one relationship: every media type has a specific writer.
- Specified by:
getValidMediaInputTypein interfaceValidMediaInput- Overrides:
getValidMediaInputTypein classJavaScriptWriter
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classJavaScriptWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classJavaScriptWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classJavaScriptWriter- Throws:
IOException
-
encode
Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Encodes the given nested type with proper encoding.- Specified by:
encodein interfaceEncode- Specified by:
encodein interfaceJavaScript- Specified by:
encodein interfaceJson- Specified by:
encodein interfaceLdJson- Specified by:
encodein interfaceText- Specified by:
encodein interfaceUrl- Overrides:
encodein classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
encode
Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Encodes the given nested type with proper encoding.- Specified by:
encodein interfaceEncode- Specified by:
encodein interfaceJavaScript- Specified by:
encodein interfaceJson- Specified by:
encodein interfaceLdJson- Specified by:
encodein interfaceText- Specified by:
encodein interfaceUrl- Overrides:
encodein classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
encode
@Deprecated public JsonWriter encode(MediaType contentType, char[] cbuf, int offset, int len) throws IOException Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Encodes the given nested type with proper encoding.- Specified by:
encodein interfaceEncode- Specified by:
encodein interfaceJavaScript- Specified by:
encodein interfaceJson- Specified by:
encodein interfaceLdJson- Specified by:
encodein interfaceText- Specified by:
encodein interfaceUrl- Overrides:
encodein classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
encode
Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Encodes the given nested type with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
encodein interfaceEncode- Specified by:
encodein interfaceJavaScript- Specified by:
encodein interfaceJson- Specified by:
encodein interfaceLdJson- Specified by:
encodein interfaceText- Specified by:
encodein interfaceUrl- Overrides:
encodein classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
encode
@Deprecated public JsonWriter encode(MediaType contentType, CharSequence csq, int start, int end) throws IOException Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Encodes the given nested type with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
encodein interfaceEncode- Specified by:
encodein interfaceJavaScript- Specified by:
encodein interfaceJson- Specified by:
encodein interfaceLdJson- Specified by:
encodein interfaceText- Specified by:
encodein interfaceUrl- Overrides:
encodein classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
encode
Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Encodes the given nested type with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
encodein interfaceEncode- Specified by:
encodein interfaceJavaScript- Specified by:
encodein interfaceJson- Specified by:
encodein interfaceLdJson- Specified by:
encodein interfaceText- Specified by:
encodein interfaceUrl- Overrides:
encodein classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
encode
@Deprecated public <Ex extends Throwable> JsonWriter encode(MediaType contentType, IOSupplierE<?, Ex> content) throws IOException, ExDeprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Encodes the given nested type with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
encodein interfaceEncode- Specified by:
encodein interfaceJavaScript- Specified by:
encodein interfaceJson- Specified by:
encodein interfaceLdJson- Specified by:
encodein interfaceText- Specified by:
encodein interfaceUrl- Overrides:
encodein classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
encode
@Deprecated public <Ex extends Throwable> JsonWriter encode(MediaType contentType, MediaWritable<Ex> content) throws IOException, Ex Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Encodes the given nested type with proper encoding.Adds prefixes and suffixes by media type, such as
"…".Does not perform any translation markups.
- Specified by:
encodein interfaceEncode- Specified by:
encodein interfaceJavaScript- Specified by:
encodein interfaceJson- Specified by:
encodein interfaceLdJson- Specified by:
encodein interfaceText- Specified by:
encodein interfaceUrl- Overrides:
encodein classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
encode
Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.Encodes the given nested type with proper encoding. This is well suited for use in a try-with-resources block.Adds prefixes and suffixes by media type, such as
"…".Does not perform any translation markups.
- Specified by:
encodein interfaceEncode- Specified by:
encodein interfaceJavaScript- Specified by:
encodein interfaceJson- Specified by:
encodein interfaceLdJson- Specified by:
encodein interfaceUrl- Overrides:
encodein classJavaScriptWriter- Returns:
- A new writer that may be used for the given content type.
This writer must be closed for completed calls to
MediaEncoder.writeSuffixTo(java.lang.Appendable, boolean).The returned writer will be of the specific subclass of
MediaWritermatchingcontentType(seeMediaType.getMediaWriterClass(). This meansMediaWriter.getValidMediaInputType()will becontentType. - Throws:
IOException
-
nl
Description copied from interface:WhitespaceWrites a newline.This is
'\n'on all platforms. If a different newline is required, such as"\r\n"for email, filter the output.- Specified by:
nlin interfaceWhitespace- Overrides:
nlin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException- See Also:
-
nli
Description copied from interface:WhitespaceWrites a newline, followed by current indentation when indentation enabled.This is
'\n'on all platforms. If a different newline is required, such as"\r\n"for email, filter the output.- Specified by:
nliin interfaceWhitespace- Overrides:
nliin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException- See Also:
-
nli
Description copied from interface:WhitespaceWrites a newline, followed by current indentation with a depth offset when indentation enabled.This is
'\n'on all platforms. If a different newline is required, such as"\r\n"for email, filter the output.- Specified by:
nliin interfaceWhitespace- Overrides:
nliin classJavaScriptWriter- Parameters:
depthOffset- A value added to the current indentation depth. For example, pass-1when performing a newline before a closing tag or ending curly brace.- Returns:
thiswriter- Throws:
IOException- See Also:
-
indent
Description copied from interface:WhitespaceWrites the current indentation when indentation enabled.- Specified by:
indentin interfaceWhitespace- Overrides:
indentin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException- See Also:
-
indent
Description copied from interface:WhitespaceWrites the current indentation with a depth offset when indentation enabled.- Specified by:
indentin interfaceWhitespace- Overrides:
indentin classJavaScriptWriter- Parameters:
depthOffset- A value added to the current indentation depth. For example, pass-1when performing a newline before a closing tag or ending curly brace.- Returns:
thiswriter- Throws:
IOException- See Also:
-
setIndent
Description copied from interface:WhitespaceEnables or disabled indentation.- Specified by:
setIndentin interfaceWhitespace- Overrides:
setIndentin classJavaScriptWriter- Returns:
thiswriter
-
setDepth
Description copied from interface:WhitespaceSets the indentation depth.- Specified by:
setDepthin interfaceWhitespace- Overrides:
setDepthin classJavaScriptWriter- Returns:
thiswriter
-
incDepth
Description copied from interface:WhitespaceIncrements the indentation depth, if enabled.- Specified by:
incDepthin interfaceWhitespace- Overrides:
incDepthin classJavaScriptWriter- Returns:
thiswriter
-
decDepth
Description copied from interface:WhitespaceDecrements the indentation depth, if enabled.- Specified by:
decDepthin interfaceWhitespace- Overrides:
decDepthin classJavaScriptWriter- Returns:
thiswriter
-
sp
Description copied from interface:WhitespaceWrites one space character.- Specified by:
spin interfaceWhitespace- Overrides:
spin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException- See Also:
-
sp
Description copied from interface:WhitespaceWrites the given number of space characters.- Specified by:
spin interfaceWhitespace- Overrides:
spin classJavaScriptWriter- Parameters:
count- Whencount <= 0, nothing is written.- Returns:
thiswriter- Throws:
IOException- See Also:
-
javascript
Deprecated.Already writing JSON object graphWrites the given JavaScript with proper encoding.Adds prefixes and suffixes by media type, such as
<script>…</script>.- Specified by:
javascriptin interfaceJavaScript- Overrides:
javascriptin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
javascript
Deprecated.Already writing JSON object graphWrites the given JavaScript with proper encoding.Adds prefixes and suffixes by media type, such as
<script>…</script>.- Specified by:
javascriptin interfaceJavaScript- Overrides:
javascriptin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
javascript
Deprecated.Already writing JSON object graphWrites the given JavaScript with proper encoding.Adds prefixes and suffixes by media type, such as
<script>…</script>.- Specified by:
javascriptin interfaceJavaScript- Overrides:
javascriptin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
javascript
Deprecated.Already writing JSON object graphWrites the given JavaScript with proper encoding.Adds prefixes and suffixes by media type, such as
<script>…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
javascriptin interfaceJavaScript- Overrides:
javascriptin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
javascript
Deprecated.Already writing JSON object graphWrites the given JavaScript with proper encoding.Adds prefixes and suffixes by media type, such as
<script>…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
javascriptin interfaceJavaScript- Overrides:
javascriptin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
javascript
Deprecated.Already writing JSON object graphWrites the given JavaScript with proper encoding.Adds prefixes and suffixes by media type, such as
<script>…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
javascriptin interfaceJavaScript- Overrides:
javascriptin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
javascript
@Deprecated public <Ex extends Throwable> JsonWriter javascript(IOSupplierE<?, Ex> javascript) throws IOException, ExDeprecated.Already writing JSON object graphWrites the given JavaScript with proper encoding.Adds prefixes and suffixes by media type, such as
<script>…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
javascriptin interfaceJavaScript- Overrides:
javascriptin classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
javascript
@Deprecated public <Ex extends Throwable> JsonWriter javascript(JavaScriptWritable<Ex> javascript) throws IOException, Ex Deprecated.Already writing JSON object graphWrites the given JavaScript with proper encoding.Adds prefixes and suffixes by media type, such as
<script>…</script>.Does not perform any translation markups.
- Specified by:
javascriptin interfaceJavaScript- Overrides:
javascriptin classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
javascript
Deprecated.Already writing JSON object graphWrites the given JavaScript with proper encoding. This is well suited for use in a try-with-resources block.Adds prefixes and suffixes by media type, such as
<script>…</script>.Does not perform any translation markups.
- Specified by:
javascriptin interfaceJavaScript- Overrides:
javascriptin classJavaScriptWriter- Returns:
- A new writer that may be used for arbitrary JavaScript.
This writer must be closed for completed calls to
MediaEncoder.writeSuffixTo(java.lang.Appendable, boolean). - Throws:
IOException
-
json
Deprecated.Already writing JSON object graphWrites the given JSON object graph with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>.- Specified by:
jsonin interfaceJson- Overrides:
jsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
json
Deprecated.Already writing JSON object graphWrites the given JSON object graph with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>.- Specified by:
jsonin interfaceJson- Overrides:
jsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
json
Deprecated.Already writing JSON object graphWrites the given JSON object graph with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>.- Specified by:
jsonin interfaceJson- Overrides:
jsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
json
Deprecated.Already writing JSON object graphWrites the given JSON object graph with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
jsonin interfaceJson- Overrides:
jsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
json
Deprecated.Already writing JSON object graphWrites the given JSON object graph with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
jsonin interfaceJson- Overrides:
jsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
json
Deprecated.Already writing JSON object graphWrites the given JSON object graph with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
jsonin interfaceJson- Overrides:
jsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
json
@Deprecated public <Ex extends Throwable> JsonWriter json(IOSupplierE<?, Ex> json) throws IOException, ExDeprecated.Already writing JSON object graphWrites the given JSON object graph with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
jsonin interfaceJson- Overrides:
jsonin classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
json
@Deprecated public <Ex extends Throwable> JsonWriter json(JsonWritable<Ex> json) throws IOException, Ex Deprecated.Already writing JSON object graphWrites the given JSON object graph with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>.Does not perform any translation markups.
- Specified by:
jsonin interfaceJson- Overrides:
jsonin classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
json
Deprecated.Already writing JSON object graphWrites the given JSON object graph with proper encoding. This is well suited for use in a try-with-resources block.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>.Does not perform any translation markups.
- Specified by:
jsonin interfaceJson- Overrides:
jsonin classJavaScriptWriter- Returns:
- A new writer that may be used for arbitrary JSON object graph.
This writer must be closed for completed calls to
MediaEncoder.writeSuffixTo(java.lang.Appendable, boolean). - Throws:
IOException
-
ldJson
Deprecated.Already writing JSON object graphWrites the given JSON linked data with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/ld+json">…</script>.- Specified by:
ldJsonin interfaceLdJson- Overrides:
ldJsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
ldJson
Deprecated.Already writing JSON object graphWrites the given JSON linked data with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/ld+json">…</script>.- Specified by:
ldJsonin interfaceLdJson- Overrides:
ldJsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
ldJson
Deprecated.Already writing JSON object graphWrites the given JSON linked data with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/ld+json">…</script>.- Specified by:
ldJsonin interfaceLdJson- Overrides:
ldJsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
ldJson
Deprecated.Already writing JSON object graphWrites the given JSON linked data with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/ld+json">…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
ldJsonin interfaceLdJson- Overrides:
ldJsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
ldJson
Deprecated.Already writing JSON object graphWrites the given JSON linked data with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/ld+json">…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
ldJsonin interfaceLdJson- Overrides:
ldJsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
ldJson
Deprecated.Already writing JSON object graphWrites the given JSON linked data with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/ld+json">…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
ldJsonin interfaceLdJson- Overrides:
ldJsonin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
ldJson
@Deprecated public <Ex extends Throwable> JsonWriter ldJson(IOSupplierE<?, Ex> ldJson) throws IOException, ExDeprecated.Already writing JSON object graphWrites the given JSON linked data with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/ld+json">…</script>.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
ldJsonin interfaceLdJson- Overrides:
ldJsonin classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
ldJson
@Deprecated public <Ex extends Throwable> JsonWriter ldJson(LdJsonWritable<Ex> ldJson) throws IOException, Ex Deprecated.Already writing JSON object graphWrites the given JSON linked data with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/ld+json">…</script>.Does not perform any translation markups.
- Specified by:
ldJsonin interfaceLdJson- Overrides:
ldJsonin classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
ldJson
Deprecated.Already writing JSON object graphWrites the given JSON linked data with proper encoding. This is well suited for use in a try-with-resources block.Adds prefixes and suffixes by media type, such as
<script type="application/ld+json">…</script>.Does not perform any translation markups.
- Specified by:
ldJsonin interfaceLdJson- Overrides:
ldJsonin classJavaScriptWriter- Returns:
- A new writer that may be used for arbitrary JSON linked data.
This writer must be closed for completed calls to
MediaEncoder.writeSuffixTo(java.lang.Appendable, boolean). - Throws:
IOException
-
nbsp
Description copied from interface:Text- Specified by:
nbspin interfaceText- Overrides:
nbspin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException- See Also:
-
nbsp
Description copied from interface:TextWrites the given number of non-breaking space characters.- Specified by:
nbspin interfaceText- Overrides:
nbspin classJavaScriptWriter- Parameters:
count- Whencount <= 0, nothing is written.- Returns:
thiswriter- Throws:
IOException- See Also:
-
text
Description copied from interface:Text- Specified by:
textin interfaceText- Overrides:
textin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
text
Description copied from interface:Text- Specified by:
textin interfaceText- Overrides:
textin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
text
Description copied from interface:Text- Specified by:
textin interfaceText- Overrides:
textin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
text
Description copied from interface:TextWrites the given text with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
textin interfaceText- Overrides:
textin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
text
Description copied from interface:TextWrites the given text with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
textin interfaceText- Overrides:
textin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
text
Description copied from interface:TextWrites the given text with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
textin interfaceText- Overrides:
textin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
text
Description copied from interface:TextWrites the given text with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
textin interfaceText- Overrides:
textin classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
text
Description copied from interface:TextWrites the given text with proper encoding.Adds prefixes and suffixes by media type, such as
"…".Does not perform any translation markups.
- Specified by:
textin interfaceText- Overrides:
textin classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
url
Description copied from interface:UrlWrites the given RFC 3986 URI or RFC 3987 IRI with proper encoding.- Specified by:
urlin interfaceUrl- Overrides:
urlin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
url
Description copied from interface:UrlWrites the given RFC 3986 URI or RFC 3987 IRI with proper encoding.- Specified by:
urlin interfaceUrl- Overrides:
urlin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
url
Description copied from interface:UrlWrites the given RFC 3986 URI or RFC 3987 IRI with proper encoding.- Specified by:
urlin interfaceUrl- Overrides:
urlin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
url
Description copied from interface:UrlWrites the given RFC 3986 URI or RFC 3987 IRI with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
urlin interfaceUrl- Overrides:
urlin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
url
Description copied from interface:UrlWrites the given RFC 3986 URI or RFC 3987 IRI with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
urlin interfaceUrl- Overrides:
urlin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
url
Description copied from interface:UrlWrites the given RFC 3986 URI or RFC 3987 IRI with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
urlin interfaceUrl- Overrides:
urlin classJavaScriptWriter- Returns:
thiswriter- Throws:
IOException
-
url
Description copied from interface:UrlWrites the given RFC 3986 URI or RFC 3987 IRI with proper encoding.Adds prefixes and suffixes by media type, such as
"…".If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
urlin interfaceUrl- Overrides:
urlin classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
url
Description copied from interface:UrlWrites the given RFC 3986 URI or RFC 3987 IRI with proper encoding.Adds prefixes and suffixes by media type, such as
"…".Does not perform any translation markups.
- Specified by:
urlin interfaceUrl- Overrides:
urlin classJavaScriptWriter- Type Parameters:
Ex- An arbitrary exception type that may be thrown- Returns:
thiswriter- Throws:
IOExceptionEx
-
