- All Implemented Interfaces:
Encode
,JavaScript
,Json
,LdJson
,Style
,Text
,Url
,ValidMediaFilter
,ValidMediaInput
,ValidMediaOutput
,Whitespace
,Xhtml
,XhtmlAttribute
,NoClose
,Closeable
,Flushable
,Appendable
,AutoCloseable
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
Fields inherited from class com.aoapps.encoding.MediaWriter
DEFAULT_CLOSER, DEFAULT_IS_NO_CLOSE
Fields inherited from class java.io.FilterWriter
out
Fields inherited from interface com.aoapps.encoding.Whitespace
INDENT_SPACES, NL, SPACE
-
Constructor Summary
ConstructorDescriptionXhtmlWriter
(EncodingContext encodingContext, MediaEncoder encoder, Writer out) Simplified constructor.XhtmlWriter
(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>
XhtmlWriterencode
(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>
XhtmlWriterencode
(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.javascript
(char ch) Writes the given JavaScript with proper encoding.javascript
(char[] cbuf) Writes the given JavaScript with proper encoding.javascript
(char[] cbuf, int offset, int len) Writes the given JavaScript with proper encoding.<Ex extends Throwable>
XhtmlWriterjavascript
(JavaScriptWritable<Ex> javascript) Writes the given JavaScript with proper encoding.<Ex extends Throwable>
XhtmlWriterjavascript
(IOSupplierE<?, Ex> javascript) Writes the given JavaScript with proper encoding.javascript
(CharSequence csq) Writes the given JavaScript with proper encoding.javascript
(CharSequence csq, int start, int end) Writes the given JavaScript with proper encoding.javascript
(Object javascript) Writes the given JavaScript with proper encoding.json
(char ch) Writes the given JSON object graph with proper encoding.json
(char[] cbuf) Writes the given JSON object graph with proper encoding.json
(char[] cbuf, int offset, int len) Writes the given JSON object graph with proper encoding.<Ex extends Throwable>
XhtmlWriterjson
(JsonWritable<Ex> json) Writes the given JSON object graph with proper encoding.<Ex extends Throwable>
XhtmlWriterjson
(IOSupplierE<?, Ex> json) Writes the given JSON object graph with proper encoding.json
(CharSequence csq) Writes the given JSON object graph with proper encoding.json
(CharSequence csq, int start, int end) Writes the given JSON object graph with proper encoding.Writes the given JSON object graph with proper encoding.ldJson
(char ch) Writes the given JSON linked data with proper encoding.ldJson
(char[] cbuf) Writes the given JSON linked data with proper encoding.ldJson
(char[] cbuf, int offset, int len) Writes the given JSON linked data with proper encoding.<Ex extends Throwable>
XhtmlWriterldJson
(LdJsonWritable<Ex> ldJson) Writes the given JSON linked data with proper encoding.<Ex extends Throwable>
XhtmlWriterldJson
(IOSupplierE<?, Ex> ldJson) Writes the given JSON linked data with proper encoding.ldJson
(CharSequence csq) Writes the given JSON linked data with proper encoding.ldJson
(CharSequence csq, int start, int end) Writes the given JSON linked data with proper encoding.Writes the given JSON linked data with proper encoding.nbsp()
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.style
(char ch) Writes the given CSS stylesheet with proper encoding.style
(char[] cbuf) Writes the given CSS stylesheet with proper encoding.style
(char[] cbuf, int offset, int len) Writes the given CSS stylesheet with proper encoding.<Ex extends Throwable>
XhtmlWriterstyle
(StyleWritable<Ex> style) Writes the given CSS stylesheet with proper encoding.<Ex extends Throwable>
XhtmlWriterstyle
(IOSupplierE<?, Ex> style) Writes the given CSS stylesheet with proper encoding.style
(CharSequence csq) Writes the given CSS stylesheet with proper encoding.style
(CharSequence csq, int start, int end) Writes the given CSS stylesheet with proper encoding.Writes the given CSS stylesheet with proper encoding.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>
XhtmlWritertext
(TextWritable<Ex> text) Writes the given text with proper encoding.<Ex extends Throwable>
XhtmlWritertext
(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>
XhtmlWriterurl
(UrlWritable<Ex> url) Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.<Ex extends Throwable>
XhtmlWriterurl
(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.xhtml()
Deprecated.Already writing XHTMLxhtml
(char ch) Deprecated.Already writing XHTMLxhtml
(char[] cbuf) Deprecated.Already writing XHTMLxhtml
(char[] cbuf, int offset, int len) Deprecated.Already writing XHTML<Ex extends Throwable>
XhtmlWriterxhtml
(XhtmlWritable<Ex> xhtml) Deprecated.Already writing XHTML<Ex extends Throwable>
XhtmlWriterxhtml
(IOSupplierE<?, Ex> xhtml) Deprecated.Already writing XHTMLxhtml
(CharSequence csq) Deprecated.Already writing XHTMLxhtml
(CharSequence csq, int start, int end) Deprecated.Already writing XHTMLDeprecated.Already writing XHTMLxhtmlAttribute
(char ch) Writes the given (X)HTML Attribute with proper encoding.xhtmlAttribute
(char[] cbuf) Writes the given (X)HTML Attribute with proper encoding.xhtmlAttribute
(char[] cbuf, int offset, int len) Writes the given (X)HTML Attribute with proper encoding.<Ex extends Throwable>
XhtmlWriterxhtmlAttribute
(XhtmlAttributeWritable<Ex> xhtmlAttribute) Writes the given (X)HTML Attribute with proper encoding.<Ex extends Throwable>
XhtmlWriterxhtmlAttribute
(IOSupplierE<?, Ex> xhtmlAttribute) Writes the given (X)HTML Attribute with proper encoding.Writes the given (X)HTML Attribute with proper encoding.xhtmlAttribute
(CharSequence csq, int start, int end) Writes the given (X)HTML Attribute with proper encoding.xhtmlAttribute
(Object xhtmlAttribute) Writes the given (X)HTML Attribute with proper encoding.Methods inherited from class com.aoapps.encoding.WhitespaceWriter
getDepth, getIndent
Methods inherited from class com.aoapps.encoding.MediaWriter
canSkipValidation, close, getEncoder, getEncodingContext, getValidMediaOutputType, isNoClose, isValidatingMediaInputType
Methods inherited from class com.aoapps.lang.io.EncoderWriter
getOut, write, write, write, write, write, writePrefix, writeSuffix, writeSuffix
Methods inherited from class java.io.FilterWriter
flush
Methods inherited from class java.io.Writer
nullWriter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.aoapps.encoding.JavaScript
javascript
Methods inherited from interface com.aoapps.encoding.XhtmlAttribute
xhtmlAttribute
-
Constructor Details
-
XhtmlWriter
public XhtmlWriter(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
- Isout
already 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.
-
XhtmlWriter
Simplified constructor.- Parameters:
out
- Passed throughCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
- See Also:
-
-
Method Details
-
getValidMediaInputType
Description copied from class:MediaWriter
Gets 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:
getValidMediaInputType
in interfaceValidMediaInput
- Specified by:
getValidMediaInputType
in classMediaWriter
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWhitespaceWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWhitespaceWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWhitespaceWriter
- 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:
encode
in interfaceEncode
- Specified by:
encode
in interfaceJavaScript
- Specified by:
encode
in interfaceJson
- Specified by:
encode
in interfaceLdJson
- Specified by:
encode
in interfaceStyle
- Specified by:
encode
in interfaceText
- Specified by:
encode
in interfaceUrl
- Specified by:
encode
in interfaceXhtml
- Specified by:
encode
in interfaceXhtmlAttribute
- Overrides:
encode
in classWhitespaceWriter
- Returns:
this
writer- 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:
encode
in interfaceEncode
- Specified by:
encode
in interfaceJavaScript
- Specified by:
encode
in interfaceJson
- Specified by:
encode
in interfaceLdJson
- Specified by:
encode
in interfaceStyle
- Specified by:
encode
in interfaceText
- Specified by:
encode
in interfaceUrl
- Specified by:
encode
in interfaceXhtml
- Specified by:
encode
in interfaceXhtmlAttribute
- Overrides:
encode
in classWhitespaceWriter
- Returns:
this
writer- Throws:
IOException
-
encode
@Deprecated public XhtmlWriter 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:
encode
in interfaceEncode
- Specified by:
encode
in interfaceJavaScript
- Specified by:
encode
in interfaceJson
- Specified by:
encode
in interfaceLdJson
- Specified by:
encode
in interfaceStyle
- Specified by:
encode
in interfaceText
- Specified by:
encode
in interfaceUrl
- Specified by:
encode
in interfaceXhtml
- Specified by:
encode
in interfaceXhtmlAttribute
- Overrides:
encode
in classWhitespaceWriter
- Returns:
this
writer- 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:
encode
in interfaceEncode
- Specified by:
encode
in interfaceJavaScript
- Specified by:
encode
in interfaceJson
- Specified by:
encode
in interfaceLdJson
- Specified by:
encode
in interfaceStyle
- Specified by:
encode
in interfaceText
- Specified by:
encode
in interfaceUrl
- Specified by:
encode
in interfaceXhtml
- Specified by:
encode
in interfaceXhtmlAttribute
- Overrides:
encode
in classWhitespaceWriter
- Returns:
this
writer- Throws:
IOException
-
encode
@Deprecated public XhtmlWriter 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:
encode
in interfaceEncode
- Specified by:
encode
in interfaceJavaScript
- Specified by:
encode
in interfaceJson
- Specified by:
encode
in interfaceLdJson
- Specified by:
encode
in interfaceStyle
- Specified by:
encode
in interfaceText
- Specified by:
encode
in interfaceUrl
- Specified by:
encode
in interfaceXhtml
- Specified by:
encode
in interfaceXhtmlAttribute
- Overrides:
encode
in classWhitespaceWriter
- Returns:
this
writer- 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:
encode
in interfaceEncode
- Specified by:
encode
in interfaceJavaScript
- Specified by:
encode
in interfaceJson
- Specified by:
encode
in interfaceLdJson
- Specified by:
encode
in interfaceStyle
- Specified by:
encode
in interfaceText
- Specified by:
encode
in interfaceUrl
- Specified by:
encode
in interfaceXhtml
- Specified by:
encode
in interfaceXhtmlAttribute
- Overrides:
encode
in classWhitespaceWriter
- Returns:
this
writer- Throws:
IOException
-
encode
@Deprecated public <Ex extends Throwable> XhtmlWriter 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:
encode
in interfaceEncode
- Specified by:
encode
in interfaceJavaScript
- Specified by:
encode
in interfaceJson
- Specified by:
encode
in interfaceLdJson
- Specified by:
encode
in interfaceStyle
- Specified by:
encode
in interfaceText
- Specified by:
encode
in interfaceUrl
- Specified by:
encode
in interfaceXhtml
- Specified by:
encode
in interfaceXhtmlAttribute
- Overrides:
encode
in classWhitespaceWriter
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
encode
@Deprecated public <Ex extends Throwable> XhtmlWriter 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:
encode
in interfaceEncode
- Specified by:
encode
in interfaceJavaScript
- Specified by:
encode
in interfaceJson
- Specified by:
encode
in interfaceLdJson
- Specified by:
encode
in interfaceStyle
- Specified by:
encode
in interfaceText
- Specified by:
encode
in interfaceUrl
- Specified by:
encode
in interfaceXhtml
- Specified by:
encode
in interfaceXhtmlAttribute
- Overrides:
encode
in classWhitespaceWriter
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
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:
encode
in interfaceEncode
- Specified by:
encode
in interfaceJavaScript
- Specified by:
encode
in interfaceJson
- Specified by:
encode
in interfaceLdJson
- Specified by:
encode
in interfaceStyle
- Specified by:
encode
in interfaceUrl
- Specified by:
encode
in interfaceXhtml
- Specified by:
encode
in interfaceXhtmlAttribute
- Overrides:
encode
in classMediaWriter
- 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
MediaWriter
matchingcontentType
(seeMediaType.getMediaWriterClass()
. This meansMediaWriter.getValidMediaInputType()
will becontentType
. - Throws:
IOException
-
nl
Description copied from interface:Whitespace
Writes 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:
nl
in interfaceWhitespace
- Overrides:
nl
in classWhitespaceWriter
- Returns:
this
writer- Throws:
IOException
- See Also:
-
nli
Description copied from interface:Whitespace
Writes 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:
nli
in interfaceWhitespace
- Overrides:
nli
in classWhitespaceWriter
- Returns:
this
writer- Throws:
IOException
- See Also:
-
nli
Description copied from interface:Whitespace
Writes 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:
nli
in interfaceWhitespace
- Overrides:
nli
in classWhitespaceWriter
- Parameters:
depthOffset
- A value added to the current indentation depth. For example, pass-1
when performing a newline before a closing tag or ending curly brace.- Returns:
this
writer- Throws:
IOException
- See Also:
-
indent
Description copied from interface:Whitespace
Writes the current indentation when indentation enabled.- Specified by:
indent
in interfaceWhitespace
- Overrides:
indent
in classWhitespaceWriter
- Returns:
this
writer- Throws:
IOException
- See Also:
-
indent
Description copied from interface:Whitespace
Writes the current indentation with a depth offset when indentation enabled.- Specified by:
indent
in interfaceWhitespace
- Overrides:
indent
in classWhitespaceWriter
- Parameters:
depthOffset
- A value added to the current indentation depth. For example, pass-1
when performing a newline before a closing tag or ending curly brace.- Returns:
this
writer- Throws:
IOException
- See Also:
-
setIndent
Description copied from interface:Whitespace
Enables or disabled indentation.- Specified by:
setIndent
in interfaceWhitespace
- Overrides:
setIndent
in classWhitespaceWriter
- Returns:
this
writer
-
setDepth
Description copied from interface:Whitespace
Sets the indentation depth.- Specified by:
setDepth
in interfaceWhitespace
- Overrides:
setDepth
in classWhitespaceWriter
- Returns:
this
writer
-
incDepth
Description copied from interface:Whitespace
Increments the indentation depth, if enabled.- Specified by:
incDepth
in interfaceWhitespace
- Overrides:
incDepth
in classWhitespaceWriter
- Returns:
this
writer
-
decDepth
Description copied from interface:Whitespace
Decrements the indentation depth, if enabled.- Specified by:
decDepth
in interfaceWhitespace
- Overrides:
decDepth
in classWhitespaceWriter
- Returns:
this
writer
-
sp
Description copied from interface:Whitespace
Writes one space character.- Specified by:
sp
in interfaceWhitespace
- Overrides:
sp
in classWhitespaceWriter
- Returns:
this
writer- Throws:
IOException
- See Also:
-
sp
Description copied from interface:Whitespace
Writes the given number of space characters.- Specified by:
sp
in interfaceWhitespace
- Overrides:
sp
in classWhitespaceWriter
- Parameters:
count
- Whencount <= 0
, nothing is written.- Returns:
this
writer- Throws:
IOException
- See Also:
-
xhtml
Deprecated.Already writing XHTML- Specified by:
xhtml
in interfaceXhtml
- Returns:
this
writer- Throws:
IOException
-
xhtml
Deprecated.Already writing XHTML- Specified by:
xhtml
in interfaceXhtml
- Returns:
this
writer- Throws:
IOException
-
xhtml
Deprecated.Already writing XHTML- Specified by:
xhtml
in interfaceXhtml
- Returns:
this
writer- Throws:
IOException
-
xhtml
Deprecated.Already writing XHTMLWrites the given (X)HTML with proper encoding.Adds prefixes and suffixes by media type.
If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
xhtml
in interfaceXhtml
- Returns:
this
writer- Throws:
IOException
-
xhtml
Deprecated.Already writing XHTMLWrites the given (X)HTML with proper encoding.Adds prefixes and suffixes by media type.
If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
xhtml
in interfaceXhtml
- Returns:
this
writer- Throws:
IOException
-
xhtml
Deprecated.Already writing XHTMLWrites the given (X)HTML with proper encoding.Adds prefixes and suffixes by media type.
If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
xhtml
in interfaceXhtml
- Returns:
this
writer- Throws:
IOException
-
xhtml
@Deprecated public <Ex extends Throwable> XhtmlWriter xhtml(IOSupplierE<?, Ex> xhtml) throws IOException, ExDeprecated.Already writing XHTMLWrites the given (X)HTML with proper encoding.Adds prefixes and suffixes by media type.
If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
xhtml
in interfaceXhtml
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
xhtml
@Deprecated public <Ex extends Throwable> XhtmlWriter xhtml(XhtmlWritable<Ex> xhtml) throws IOException, Ex Deprecated.Already writing XHTMLWrites the given (X)HTML with proper encoding.Adds prefixes and suffixes by media type.
Does not perform any translation markups.
- Specified by:
xhtml
in interfaceXhtml
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
xhtml
Deprecated.Already writing XHTMLWrites the given (X)HTML with proper encoding. This is well suited for use in a try-with-resources block.Adds prefixes and suffixes by media type.
Does not perform any translation markups.
- Specified by:
xhtml
in interfaceXhtml
- Returns:
- A new writer that may be used for arbitrary (X)HTML.
This writer must be closed for completed calls to
MediaEncoder.writeSuffixTo(java.lang.Appendable, boolean)
. - Throws:
IOException
-
xhtmlAttribute
Description copied from interface:XhtmlAttribute
- Specified by:
xhtmlAttribute
in interfaceXhtmlAttribute
- Returns:
this
writer- Throws:
IOException
-
xhtmlAttribute
Description copied from interface:XhtmlAttribute
- Specified by:
xhtmlAttribute
in interfaceXhtmlAttribute
- Returns:
this
writer- Throws:
IOException
-
xhtmlAttribute
Description copied from interface:XhtmlAttribute
- Specified by:
xhtmlAttribute
in interfaceXhtmlAttribute
- Returns:
this
writer- Throws:
IOException
-
xhtmlAttribute
Description copied from interface:XhtmlAttribute
Writes the given (X)HTML Attribute with proper encoding.Adds prefixes and suffixes by media type.
If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
xhtmlAttribute
in interfaceXhtmlAttribute
- Returns:
this
writer- Throws:
IOException
-
xhtmlAttribute
Description copied from interface:XhtmlAttribute
Writes the given (X)HTML Attribute with proper encoding.Adds prefixes and suffixes by media type.
If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
xhtmlAttribute
in interfaceXhtmlAttribute
- Returns:
this
writer- Throws:
IOException
-
xhtmlAttribute
Description copied from interface:XhtmlAttribute
Writes the given (X)HTML Attribute with proper encoding.Adds prefixes and suffixes by media type.
If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
xhtmlAttribute
in interfaceXhtmlAttribute
- Returns:
this
writer- Throws:
IOException
-
xhtmlAttribute
public <Ex extends Throwable> XhtmlWriter xhtmlAttribute(IOSupplierE<?, Ex> xhtmlAttribute) throws IOException, ExDescription copied from interface:XhtmlAttribute
Writes the given (X)HTML Attribute with proper encoding.Adds prefixes and suffixes by media type.
If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
xhtmlAttribute
in interfaceXhtmlAttribute
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
xhtmlAttribute
public <Ex extends Throwable> XhtmlWriter xhtmlAttribute(XhtmlAttributeWritable<Ex> xhtmlAttribute) throws IOException, Ex Description copied from interface:XhtmlAttribute
Writes the given (X)HTML Attribute with proper encoding.Adds prefixes and suffixes by media type.
Does not perform any translation markups.
- Specified by:
xhtmlAttribute
in interfaceXhtmlAttribute
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
style
Description copied from interface:Style
Writes the given CSS stylesheet with proper encoding.Adds prefixes and suffixes by media type, such as
<style>…</style>
.- Specified by:
style
in interfaceStyle
- Returns:
this
writer- Throws:
IOException
-
style
Description copied from interface:Style
Writes the given CSS stylesheet with proper encoding.Adds prefixes and suffixes by media type, such as
<style>…</style>
.- Specified by:
style
in interfaceStyle
- Returns:
this
writer- Throws:
IOException
-
style
Description copied from interface:Style
Writes the given CSS stylesheet with proper encoding.Adds prefixes and suffixes by media type, such as
<style>…</style>
.- Specified by:
style
in interfaceStyle
- Returns:
this
writer- Throws:
IOException
-
style
Description copied from interface:Style
Writes the given CSS stylesheet with proper encoding.Adds prefixes and suffixes by media type, such as
<style>…</style>
.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
style
in interfaceStyle
- Returns:
this
writer- Throws:
IOException
-
style
Description copied from interface:Style
Writes the given CSS stylesheet with proper encoding.Adds prefixes and suffixes by media type, such as
<style>…</style>
.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
style
in interfaceStyle
- Returns:
this
writer- Throws:
IOException
-
style
Description copied from interface:Style
Writes the given CSS stylesheet with proper encoding.Adds prefixes and suffixes by media type, such as
<style>…</style>
.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
style
in interfaceStyle
- Returns:
this
writer- Throws:
IOException
-
style
Description copied from interface:Style
Writes the given CSS stylesheet with proper encoding.Adds prefixes and suffixes by media type, such as
<style>…</style>
.If the string is translated, comments will be added giving the translation lookup id to aid in translation of server-translated values.
- Specified by:
style
in interfaceStyle
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
style
Description copied from interface:Style
Writes the given CSS stylesheet with proper encoding.Adds prefixes and suffixes by media type, such as
<style>…</style>
.Does not perform any translation markups.
- Specified by:
style
in interfaceStyle
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
javascript
Description copied from interface:JavaScript
Writes the given JavaScript with proper encoding.Adds prefixes and suffixes by media type, such as
<script>…</script>
.- Specified by:
javascript
in interfaceJavaScript
- Returns:
this
writer- Throws:
IOException
-
javascript
Description copied from interface:JavaScript
Writes the given JavaScript with proper encoding.Adds prefixes and suffixes by media type, such as
<script>…</script>
.- Specified by:
javascript
in interfaceJavaScript
- Returns:
this
writer- Throws:
IOException
-
javascript
Description copied from interface:JavaScript
Writes the given JavaScript with proper encoding.Adds prefixes and suffixes by media type, such as
<script>…</script>
.- Specified by:
javascript
in interfaceJavaScript
- Returns:
this
writer- Throws:
IOException
-
javascript
Description copied from interface:JavaScript
Writes 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:
javascript
in interfaceJavaScript
- Returns:
this
writer- Throws:
IOException
-
javascript
Description copied from interface:JavaScript
Writes 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:
javascript
in interfaceJavaScript
- Returns:
this
writer- Throws:
IOException
-
javascript
Description copied from interface:JavaScript
Writes 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:
javascript
in interfaceJavaScript
- Returns:
this
writer- Throws:
IOException
-
javascript
public <Ex extends Throwable> XhtmlWriter javascript(IOSupplierE<?, Ex> javascript) throws IOException, ExDescription copied from interface:JavaScript
Writes 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:
javascript
in interfaceJavaScript
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
javascript
public <Ex extends Throwable> XhtmlWriter javascript(JavaScriptWritable<Ex> javascript) throws IOException, Ex Description copied from interface:JavaScript
Writes 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:
javascript
in interfaceJavaScript
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
json
Description copied from interface:Json
Writes the given JSON object graph with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>
.- Specified by:
json
in interfaceJson
- Returns:
this
writer- Throws:
IOException
-
json
Description copied from interface:Json
Writes the given JSON object graph with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>
.- Specified by:
json
in interfaceJson
- Returns:
this
writer- Throws:
IOException
-
json
Description copied from interface:Json
Writes the given JSON object graph with proper encoding.Adds prefixes and suffixes by media type, such as
<script type="application/json">…</script>
.- Specified by:
json
in interfaceJson
- Returns:
this
writer- Throws:
IOException
-
json
Description copied from interface:Json
Writes 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:
json
in interfaceJson
- Returns:
this
writer- Throws:
IOException
-
json
Description copied from interface:Json
Writes 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:
json
in interfaceJson
- Returns:
this
writer- Throws:
IOException
-
json
Description copied from interface:Json
Writes 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:
json
in interfaceJson
- Returns:
this
writer- Throws:
IOException
-
json
Description copied from interface:Json
Writes 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:
json
in interfaceJson
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
json
Description copied from interface:Json
Writes 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:
json
in interfaceJson
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
ldJson
Description copied from interface:LdJson
Writes 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:
ldJson
in interfaceLdJson
- Returns:
this
writer- Throws:
IOException
-
ldJson
Description copied from interface:LdJson
Writes 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:
ldJson
in interfaceLdJson
- Returns:
this
writer- Throws:
IOException
-
ldJson
Description copied from interface:LdJson
Writes 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:
ldJson
in interfaceLdJson
- Returns:
this
writer- Throws:
IOException
-
ldJson
Description copied from interface:LdJson
Writes 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:
ldJson
in interfaceLdJson
- Returns:
this
writer- Throws:
IOException
-
ldJson
Description copied from interface:LdJson
Writes 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:
ldJson
in interfaceLdJson
- Returns:
this
writer- Throws:
IOException
-
ldJson
Description copied from interface:LdJson
Writes 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:
ldJson
in interfaceLdJson
- Returns:
this
writer- Throws:
IOException
-
ldJson
Description copied from interface:LdJson
Writes 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:
ldJson
in interfaceLdJson
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
ldJson
Description copied from interface:LdJson
Writes 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:
ldJson
in interfaceLdJson
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
nbsp
Description copied from interface:Text
- Specified by:
nbsp
in interfaceText
- Returns:
this
writer- Throws:
IOException
- See Also:
-
nbsp
Description copied from interface:Text
Writes the given number of non-breaking space characters.- Specified by:
nbsp
in interfaceText
- Parameters:
count
- Whencount <= 0
, nothing is written.- Returns:
this
writer- Throws:
IOException
- See Also:
-
text
Description copied from interface:Text
- Specified by:
text
in interfaceText
- Returns:
this
writer- Throws:
IOException
-
text
Description copied from interface:Text
- Specified by:
text
in interfaceText
- Returns:
this
writer- Throws:
IOException
-
text
Description copied from interface:Text
- Specified by:
text
in interfaceText
- Returns:
this
writer- Throws:
IOException
-
text
Description copied from interface:Text
Writes 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:
text
in interfaceText
- Returns:
this
writer- Throws:
IOException
-
text
Description copied from interface:Text
Writes 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:
text
in interfaceText
- Returns:
this
writer- Throws:
IOException
-
text
Description copied from interface:Text
Writes 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:
text
in interfaceText
- Returns:
this
writer- Throws:
IOException
-
text
Description copied from interface:Text
Writes 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:
text
in interfaceText
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
text
Description copied from interface:Text
Writes the given text with proper encoding.Adds prefixes and suffixes by media type, such as
"…"
.Does not perform any translation markups.
- Specified by:
text
in interfaceText
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
url
Description copied from interface:Url
Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.- Specified by:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
Description copied from interface:Url
Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.- Specified by:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
Description copied from interface:Url
Writes the given RFC 3986 URI or RFC 3987 IRI with proper encoding.- Specified by:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
Description copied from interface:Url
Writes 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:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
Description copied from interface:Url
Writes 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:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
Description copied from interface:Url
Writes 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:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
Description copied from interface:Url
Writes 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:
url
in interfaceUrl
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
url
Description copied from interface:Url
Writes 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:
url
in interfaceUrl
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-