- All Implemented Interfaces:
Encode
,Url
,ValidMediaFilter
,ValidMediaInput
,ValidMediaOutput
,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
-
Constructor Summary
ConstructorDescriptionUrlWriter
(EncodingContext encodingContext, MediaEncoder encoder, Writer out) Simplified constructor.UrlWriter
(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) 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.encode
(MediaType contentType, MediaWritable<Ex> content) Deprecated.Encoding of arbitrary content types is not expected since all supported types have per-type methods.encode
(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.url()
Deprecated.Already writing URLurl
(char ch) Deprecated.Already writing URLurl
(char[] cbuf) Deprecated.Already writing URLurl
(char[] cbuf, int offset, int len) Deprecated.Already writing URLurl
(UrlWritable<Ex> url) Deprecated.Already writing URLurl
(IOSupplierE<?, Ex> url) Deprecated.Already writing URLurl
(CharSequence csq) Deprecated.Already writing URLurl
(CharSequence csq, int start, int end) Deprecated.Already writing URLDeprecated.Already writing URLMethods 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
-
Constructor Details
-
UrlWriter
public UrlWriter(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.
-
UrlWriter
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 classMediaWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classMediaWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classMediaWriter
- 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 interfaceUrl
- Overrides:
encode
in classMediaWriter
- 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 interfaceUrl
- Overrides:
encode
in classMediaWriter
- Returns:
this
writer- Throws:
IOException
-
encode
@Deprecated public UrlWriter 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 interfaceUrl
- Overrides:
encode
in classMediaWriter
- 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 interfaceUrl
- Overrides:
encode
in classMediaWriter
- Returns:
this
writer- Throws:
IOException
-
encode
@Deprecated public UrlWriter 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 interfaceUrl
- Overrides:
encode
in classMediaWriter
- 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 interfaceUrl
- Overrides:
encode
in classMediaWriter
- Returns:
this
writer- Throws:
IOException
-
encode
@Deprecated public <Ex extends Throwable> UrlWriter 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 interfaceUrl
- Overrides:
encode
in classMediaWriter
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
encode
@Deprecated public <Ex extends Throwable> UrlWriter 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 interfaceUrl
- Overrides:
encode
in classMediaWriter
- 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 interfaceUrl
- 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
-
url
Deprecated.Already writing URLWrites the given RFC 3986 URI or RFC 3987 IRI with proper encoding.- Specified by:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
Deprecated.Already writing URLWrites the given RFC 3986 URI or RFC 3987 IRI with proper encoding.- Specified by:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
Deprecated.Already writing URLWrites the given RFC 3986 URI or RFC 3987 IRI with proper encoding.- Specified by:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
Deprecated.Already writing 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:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
Deprecated.Already writing 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:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
Deprecated.Already writing 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:
url
in interfaceUrl
- Returns:
this
writer- Throws:
IOException
-
url
@Deprecated public <Ex extends Throwable> UrlWriter url(IOSupplierE<?, Ex> url) throws IOException, ExDeprecated.Already writing 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:
url
in interfaceUrl
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
url
Deprecated.Already writing 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:
url
in interfaceUrl
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
writer- Throws:
IOException
Ex
-
url
Deprecated.Already writing URLWrites the given RFC 3986 URI or RFC 3987 IRI 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:
url
in interfaceUrl
- Returns:
- A new writer that may be used for arbitrary RFC 3986 URI or
RFC 3987 IRI.
This writer must be closed for completed calls to
MediaEncoder.writeSuffixTo(java.lang.Appendable, boolean)
. - Throws:
IOException
-