- Type Parameters:
D
- This document type
- All Implemented Interfaces:
Encode
,Text
,Whitespace
,AnyCOLGROUP_content<D,
,D> AnyContent<D,
,D> AnyDATALIST_content<D,
,D> AnyDIV_content<D,
,D> AnyDL_content<D,
,D> AnyEmbeddedContent<D,
,D> AnyFlowContent<D,
,D> AnyHeadingContent<D,
,D> AnyHTML_content<D,
,D> AnyInteractiveContent<D,
,D> AnyListContent<D,
,D> AnyMetadataContent<D,
,D> AnyOBJECT_content<D,
,D> AnyOPTGROUP_content<D,
,D> AnyPalpableContent<D,
,D> AnyPhrasingContent<D,
,D> AnyScriptSupportingContent<D,
,D> AnySectioningContent<D,
,D> AnySELECT_content<D,
,D> AnyTABLE_content<D,
,D> AnyTextContent<D,
,D> AnyTR_content<D,
,D> AnyUnion_COLGROUP_ScriptSupporting<D,
,D> AnyUnion_DATALIST_OPTGROUP<D,
,D> AnyUnion_DIV_DL<D,
,D> AnyUnion_DL_Palpable<D,
,D> AnyUnion_Embedded_Interactive<D,
,D> AnyUnion_Embedded_Palpable_Phrasing<D,
,D> AnyUnion_Interactive_Phrasing<D,
,D> AnyUnion_Metadata_Phrasing<D,
,D> AnyUnion_Palpable_Phrasing<D,
,D> AnyUnion_TBODY_THEAD_TFOOT<D,
,D> Content<D,
,D> DocumentWriter
This class implements all content interfaces and supports all element types.
See also HtmlFlow.
- Author:
- AO Industries, Inc.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.aoapps.html.any.AnyUnion_Interactive_Phrasing
AnyUnion_Interactive_Phrasing.InputFactory<D extends AnyDocument<D>,
__ extends AnyUnion_Interactive_Phrasing<D, __>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Charset
The default, and recommended, encoding for (X)HTML.final EncodingContext
Fields inherited from interface com.aoapps.encoding.Whitespace
INDENT_SPACES, NL, SPACE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPerforms automatic indentation whenDocumentWriter.getAutonli()
,Whitespace.getIndent()
, andDocumentWriter.getAtnl()
.autoIndent
(int depthOffset) Performs automatic indentation with a depth offset whenDocumentWriter.getAutonli()
,Whitespace.getIndent()
, andDocumentWriter.getAtnl()
.autoNl()
Performs automatic newline whenDocumentWriter.getAutonli()
and notDocumentWriter.getAtnl()
.autoNli()
Performs automatic newline whenDocumentWriter.getAutonli()
and notDocumentWriter.getAtnl()
, followed by automatic indentation when enabled.autoNli
(int depthOffset) Performs automatic newline whenDocumentWriter.getAutonli()
and notDocumentWriter.getAtnl()
, followed by automatic indentation with a depth offset when enabled.Clears the at newline flag.decDepth()
doctype()
encode
(MediaType contentType, MediaWritable<Ex> content) encode
(MediaType contentType, IOSupplierE<?, Ex> content) encode
(MediaType contentType, CharSequence csq) encode
(MediaType contentType, CharSequence csq, int start, int end) boolean
getAtnl()
Gets the at newline flag.boolean
Gets if automatic newline (and indentation when enabled) is currently enabled, off by default.int
getDepth()
Gets the document for the current content model.boolean
Deprecated.This method will remain, but its use is discouraged as it can be dangerousgetRawUnsafe
(Boolean endsNewline) Deprecated.This method will remain, but its use is discouraged as it can be dangerousincDepth()
indent()
indent
(int depthOffset) nbsp()
nbsp
(int count) nl()
nli()
nli
(int depthOffset) setAtnl()
Flags is at a newline.setAtnl
(boolean atnl) Sets the at newline flag.setAutonli
(boolean autonli) Enables or disabled automatic newline (and indentation when enabled).setDepth
(int depth) setIndent
(boolean indent) void
Replaces the writer this document is writing to.sp()
sp
(int count) text()
text
(char ch) text
(char[] cbuf) text
(char[] cbuf, int offset, int len) text
(TextWritable<Ex> text) text
(IOSupplierE<?, Ex> text) text
(CharSequence csq) text
(CharSequence csq, int start, int end) unsafe()
Deprecated.This method will remain, but its use is discouraged as it can be dangerousunsafe
(char ch) Deprecated.This method will remain, but its use is discouraged as it can be dangerousunsafe
(char[] cbuf) Deprecated.This method will remain, but its use is discouraged as it can be dangerousunsafe
(char[] cbuf, int offset, int len) Deprecated.This method will remain, but its use is discouraged as it can be dangerousunsafe
(IOSupplierE<?, Ex> unsafe) Deprecated.This method will remain, but its use is discouraged as it can be dangerousDeprecated.This method will remain, but its use is discouraged as it can be dangerousunsafe
(CharSequence csq) Deprecated.This method will remain, but its use is discouraged as it can be dangerousunsafe
(CharSequence csq, int start, int end) Deprecated.This method will remain, but its use is discouraged as it can be dangerousDeprecated.This method will remain, but its use is discouraged as it can be dangerousWrites the XML declaration, if needed, using the character encoding of the encoding context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.aoapps.html.any.AnyCOLGROUP_content
col
Methods inherited from interface com.aoapps.html.any.AnyContent
figcaption, html, html__, html__, html__any, html_c, legend, rp, rt, source, summary, tr, tr__, tr__, tr__any, track
Methods inherited from interface com.aoapps.html.any.AnyEmbeddedContent
picture
Methods inherited from interface com.aoapps.html.any.AnyFlowContent
dialog, hr, hr__
Methods inherited from interface com.aoapps.html.any.AnyHeadingContent
h, h__, h__, h__, h__, h_c, h1, h1__, h1__, h1__, h1__any, h1_c, h2, h2__, h2__, h2__, h2__any, h2_c, h3, h3__, h3__, h3__, h3__any, h3_c, h4, h4__, h4__, h4__, h4__any, h4_c, h5, h5__, h5__, h5__, h5__any, h5_c, h6, h6__, h6__, h6__, h6__any, h6_c, hgroup
Methods inherited from interface com.aoapps.html.any.AnyHTML_content
body, body__, body__, body__any, body_c, head, head__, head__, head__any, head_c
Methods inherited from interface com.aoapps.html.any.AnyInteractiveContent
details, menu, menu__, menu__, menu__any, menu_c
Methods inherited from interface com.aoapps.html.any.AnyListContent
li, li__, li__, li__, li__any, li_c
Methods inherited from interface com.aoapps.html.any.AnyMetadataContent
base, base__, style, style, style, style, style, title, title__, title__, title__any, title_c
Methods inherited from interface com.aoapps.html.any.AnyOBJECT_content
param, param__
Methods inherited from interface com.aoapps.html.any.AnyPalpableContent
address, address__, address__, address__, address__any, address_c, blockquote, blockquote__, blockquote__, blockquote__, blockquote__any, blockquote_c, dl, dl__, dl__, dl__any, dl_c, fieldset, figure, footer, footer__, footer__, footer__, footer__any, footer_c, form, form, form, form__, form__, form__, form__any, form_c, header, header__, header__, header__, header__any, header_c, main, main__, main__, main__, main__any, main_c, ol, ol__, ol__, ol__any, ol_c, p, p__, p__, p__, p__any, p_c, pre, pre__, pre__, pre__, pre__any, pre_c, table, table__, table__, table__any, table_c, ul, ul__, ul__, ul__any, ul_c
Methods inherited from interface com.aoapps.html.any.AnyPhrasingContent
area, area, area, area, area, area, area, area, area, br, br__, datalist, datalist__, datalist__, datalist__, datalist__any, datalist_c, del, del__, del__, del__, del_c, slot, wbr, wbr__
Methods inherited from interface com.aoapps.html.any.AnyScriptSupportingContent
script, script, script, script, script
Methods inherited from interface com.aoapps.html.any.AnySectioningContent
article, article__, article__, article__, article__any, article_c, aside, aside__, aside__, aside__, aside__any, aside_c, nav, nav__, nav__, nav__, nav__any, nav_c, section, section__, section__, section__, section__any, section_c
Methods inherited from interface com.aoapps.html.any.AnySELECT_content
optgroup, optgroup__, optgroup__, optgroup__any, optgroup_c
Methods inherited from interface com.aoapps.html.any.AnyTABLE_content
caption, caption__, caption__, caption__, caption__any, caption_c, colgroup, colgroup__, colgroup__, colgroup__any, colgroup_c, tbody, tbody__, tbody__, tbody__any, tbody_c, tfoot, tfoot__, tfoot__, tfoot__any, tfoot_c, thead, thead__, thead__, thead__any, thead_c
Methods inherited from interface com.aoapps.html.any.AnyTR_content
td, td__, td__, td__, td__any, td_c, th, th__, th__, th__, th__any, th_c
Methods inherited from interface com.aoapps.html.any.AnyUnion_COLGROUP_ScriptSupporting
template
Methods inherited from interface com.aoapps.html.any.AnyUnion_DATALIST_OPTGROUP
option, option__, option__, option__, option__any, option_c
Methods inherited from interface com.aoapps.html.any.AnyUnion_DIV_DL
dd, dd__, dd__, dd__, dd__any, dd_c, dt, dt__, dt__, dt__, dt__any, dt_c
Methods inherited from interface com.aoapps.html.any.AnyUnion_DL_Palpable
div, div__, div__, div__, div__any, div_c
Methods inherited from interface com.aoapps.html.any.AnyUnion_Embedded_Interactive
audio, embed, iframe, img, img, img, object, object__, object__, object__any, object_c, video
Methods inherited from interface com.aoapps.html.any.AnyUnion_Embedded_Palpable_Phrasing
canvas
Methods inherited from interface com.aoapps.html.any.AnyUnion_Interactive_Phrasing
a, a, a, a__, a__, a__, a__, a_c, button, input, label, label__, label__, label__, label__any, label_c, select, select__, select__, select__any, select_c, textarea, textarea__, textarea__, textarea__, textarea__any, textarea_c
Methods inherited from interface com.aoapps.html.any.AnyUnion_Metadata_Phrasing
link, link, meta, noscript
Methods inherited from interface com.aoapps.html.any.AnyUnion_Palpable_Phrasing
abbr, abbr__, abbr__, abbr__, abbr__any, abbr_c, b, b__, b__, b__, b__any, b_c, bdi, bdi__, bdi__, bdi__, bdi__any, bdi_c, bdo, bdo, bdo, bdo, bdo, bdo__, bdo__, bdo__, bdo__any, bdo_c, cite, cite__, cite__, cite__, cite__any, cite_c, code, code__, code__, code__, code__any, code_c, data, data, data, data__, data__, data__, data__any, data_c, dfn, dfn__, dfn__, dfn__, dfn__any, dfn_c, em, em__, em__, em__, em__any, em_c, i, i__, i__, i__, i__any, i_c, ins, ins__, ins__, ins__, ins__, ins_c, kbd, kbd__, kbd__, kbd__, kbd__any, kbd_c, map, map, map, map__, map__, map__, map__, map_c, mark, mark__, mark__, mark__, mark__any, mark_c, meter, meter__, meter__, meter__, meter__any, meter_c, output, output__, output__, output__, output__any, output_c, progress, progress__, progress__, progress__, progress__any, progress_c, q, q__, q__, q__, q__any, q_c, ruby, s, s__, s__, s__, s__any, s_c, samp, samp__, samp__, samp__, samp__any, samp_c, small, small__, small__, small__, small__any, small_c, span, span__, span__, span__, span__any, span_c, strong, strong__, strong__, strong__, strong__any, strong_c, sub, sub__, sub__, sub__, sub__any, sub_c, sup, sup__, sup__, sup__, sup__any, sup_c, time, u, u__, u__, u__, u__any, u_c, var, var__, var__, var__, var__any, var_c
Methods inherited from interface com.aoapps.html.any.AnyUnion_TBODY_THEAD_TFOOT
tr_c
-
Field Details
-
ENCODING
The default, and recommended, encoding for (X)HTML. -
encodingContext
-
-
Constructor Details
-
AnyDocument
- Parameters:
out
- May benull
, but must be set to a non-null value again before any additional writes. Not doing so may result inIllegalStateException
.Will be through
Coercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
withencoder = null
.- See Also:
-
-
Method Details
-
setOut
Replaces the writer this document is writing to.- Parameters:
out
- May benull
, but must be set to a non-null value again before any additional writes. Not doing so may result inIllegalStateException
.Will be through
Coercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
withencoder = null
.- See Also:
-
getDocument
Description copied from interface:Content
Gets the document for the current content model. The document can be used to perform raw output or write elements not expected in the current context.- Specified by:
getDocument
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>>
-
nl
Description copied from interface:Content
Delegates to
nl()
.- Specified by:
nl
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
nl
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
nl
in interfaceDocumentWriter
- Specified by:
nl
in interfaceWhitespace
- Throws:
IOException
-
nli
Description copied from interface:Content
Delegates to
nli()
.- Specified by:
nli
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
nli
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
nli
in interfaceDocumentWriter
- Specified by:
nli
in interfaceWhitespace
- Throws:
IOException
-
nli
Description copied from interface:Content
Delegates to
nli(int)
.- Specified by:
nli
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
nli
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
nli
in interfaceDocumentWriter
- Specified by:
nli
in interfaceWhitespace
- Throws:
IOException
-
indent
Description copied from interface:Content
Delegates to
indent()
.- Specified by:
indent
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
indent
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
indent
in interfaceDocumentWriter
- Specified by:
indent
in interfaceWhitespace
- Throws:
IOException
-
indent
Description copied from interface:Content
Delegates to
indent(int)
.- Specified by:
indent
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
indent
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
indent
in interfaceDocumentWriter
- Specified by:
indent
in interfaceWhitespace
- Throws:
IOException
-
getIndent
public boolean getIndent()Description copied from interface:Content
Delegates to
getIndent()
.- Specified by:
getIndent
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
getIndent
in interfaceWhitespace
-
setIndent
Description copied from interface:Content
Delegates to
setIndent(boolean)
.- Specified by:
setIndent
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
setIndent
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
setIndent
in interfaceDocumentWriter
- Specified by:
setIndent
in interfaceWhitespace
-
getDepth
public int getDepth()Description copied from interface:Content
Delegates to
getDepth()
.- Specified by:
getDepth
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
getDepth
in interfaceWhitespace
-
setDepth
Description copied from interface:Content
Delegates to
setDepth(int)
.- Specified by:
setDepth
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
setDepth
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
setDepth
in interfaceDocumentWriter
- Specified by:
setDepth
in interfaceWhitespace
-
incDepth
Description copied from interface:Content
Delegates to
incDepth()
.- Specified by:
incDepth
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
incDepth
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
incDepth
in interfaceDocumentWriter
- Specified by:
incDepth
in interfaceWhitespace
-
decDepth
Description copied from interface:Content
Delegates to
decDepth()
.- Specified by:
decDepth
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
decDepth
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
decDepth
in interfaceDocumentWriter
- Specified by:
decDepth
in interfaceWhitespace
-
sp
Description copied from interface:Content
Delegates to
sp()
.- Specified by:
sp
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
sp
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
sp
in interfaceDocumentWriter
- Specified by:
sp
in interfaceWhitespace
- Throws:
IOException
-
sp
Description copied from interface:Content
Delegates to
sp(int)
.- Specified by:
sp
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
sp
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
sp
in interfaceDocumentWriter
- Specified by:
sp
in interfaceWhitespace
- Throws:
IOException
-
getRawUnsafe
@Deprecated(forRemoval=false) public Writer getRawUnsafe(Boolean endsNewline) throws IllegalStateException Deprecated.This method will remain, but its use is discouraged as it can be dangerousGets the current writer this document is writing to, which may be used for raw output.Please prefer
DocumentWriter.unsafe()
, which is compatible with try-with-resources blocks. The writer returned here is the real, underlying writer.Delegates to
getRawUnsafe(java.lang.Boolean)
.- Specified by:
getRawUnsafe
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
getRawUnsafe
in interfaceDocumentWriter
- Parameters:
endsNewline
- Indicates whether the data that will be written will end in aWhitespace.NL
. When non-null, will callDocumentWriter.setAtnl(boolean)
with the given value.- Returns:
- The writer, already optimized via
Coercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
withencoder = null
. - Throws:
IllegalStateException
- when output has been set tonull
.- See Also:
-
getRawUnsafe
Deprecated.This method will remain, but its use is discouraged as it can be dangerousGets the current writer this document is writing to, which may be used for raw output.Please prefer
DocumentWriter.unsafe()
, which is compatible with try-with-resources blocks. The writer returned here is the real, underlying writer.With no knowledge of what will be written, calls
DocumentWriter.clearAtnl()
to be safe.Delegates to
getRawUnsafe()
.- Specified by:
getRawUnsafe
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
getRawUnsafe
in interfaceDocumentWriter
- Returns:
- The writer, already optimized via
Coercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
withencoder = null
. - Throws:
IllegalStateException
- when output has been set tonull
.- See Also:
-
unsafe
Deprecated.This method will remain, but its use is discouraged as it can be dangerousPerforms raw output of a single character, automatically determiningDocumentWriter.setAtnl(boolean)
.Delegates to
unsafe(char)
.- Specified by:
unsafe
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
unsafe
in interfaceDocumentWriter
- Returns:
this
document- Throws:
IOException
-
unsafe
Deprecated.This method will remain, but its use is discouraged as it can be dangerousPerforms raw output, automatically determiningDocumentWriter.setAtnl(boolean)
.Delegates to
unsafe(char[])
.- Specified by:
unsafe
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
unsafe
in interfaceDocumentWriter
- Returns:
this
document- Throws:
IOException
-
unsafe
Deprecated.This method will remain, but its use is discouraged as it can be dangerousPerforms raw output, automatically determiningDocumentWriter.setAtnl(boolean)
.Delegates to
unsafe(char[], int, int)
.- Specified by:
unsafe
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
unsafe
in interfaceDocumentWriter
- Returns:
this
document- Throws:
IOException
-
unsafe
Deprecated.This method will remain, but its use is discouraged as it can be dangerousPerforms raw output, automatically determiningDocumentWriter.setAtnl(boolean)
.Delegates to
unsafe(java.lang.CharSequence)
.- Specified by:
unsafe
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
unsafe
in interfaceDocumentWriter
- Returns:
this
document- Throws:
IOException
-
unsafe
@Deprecated(forRemoval=false) public D unsafe(CharSequence csq, int start, int end) throws IOException Deprecated.This method will remain, but its use is discouraged as it can be dangerousPerforms raw output, automatically determiningDocumentWriter.setAtnl(boolean)
.Delegates to
unsafe(java.lang.CharSequence, int, int)
.- Specified by:
unsafe
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
unsafe
in interfaceDocumentWriter
- Returns:
this
document- Throws:
IOException
-
unsafe
Deprecated.This method will remain, but its use is discouraged as it can be dangerousPerforms raw output, automatically determiningDocumentWriter.setAtnl(boolean)
.When no knowledge of what will be written, calls
DocumentWriter.clearAtnl()
to be safe.Delegates to
unsafe(java.lang.Object)
.- Specified by:
unsafe
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
unsafe
in interfaceDocumentWriter
- Returns:
this
document- Throws:
IOException
-
unsafe
@Deprecated(forRemoval=false) public <Ex extends Throwable> D unsafe(IOSupplierE<?, Ex> unsafe) throws IOException, ExDeprecated.This method will remain, but its use is discouraged as it can be dangerousPerforms raw output, automatically determiningDocumentWriter.setAtnl(boolean)
.When no knowledge of what will be written, calls
DocumentWriter.clearAtnl()
to be safe.Delegates to
unsafe(com.aoapps.lang.io.function.IOSupplierE)
.- Specified by:
unsafe
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
unsafe
in interfaceDocumentWriter
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
document- Throws:
IOException
Ex
-
unsafe
Deprecated.This method will remain, but its use is discouraged as it can be dangerousPerforms raw output.With no knowledge of what will be written, calls
DocumentWriter.clearAtnl()
to be safe.Delegates to
unsafe(com.aoapps.lang.io.Writable)
.- Specified by:
unsafe
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
unsafe
in interfaceDocumentWriter
- Returns:
this
document- Throws:
IOException
-
unsafe
Deprecated.This method will remain, but its use is discouraged as it can be dangerousPerforms raw output. This is well suited for use in a try-with-resources block.With no knowledge of what will be written, calls
DocumentWriter.clearAtnl()
to be safe.Delegates to
unsafe()
.- Specified by:
unsafe
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
unsafe
in interfaceDocumentWriter
- Returns:
- a writer for direct output, which will ignore any calls to
Writer.close()
to be safely used in a try-with-resources block. - Throws:
IOException
-
getAutonli
public boolean getAutonli()Description copied from interface:Content
Gets if automatic newline (and indentation when enabled) is currently enabled, off by default.Delegates to
getAutonli()
.- Specified by:
getAutonli
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
getAutonli
in interfaceDocumentWriter
-
setAutonli
Enables or disabled automatic newline (and indentation when enabled).Delegates to
setAutonli(boolean)
.- Specified by:
setAutonli
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
setAutonli
in interfaceDocumentWriter
- Returns:
this
document
-
getAtnl
public boolean getAtnl()Description copied from interface:Content
Gets the at newline flag.Delegates to
getAtnl()
.- Specified by:
getAtnl
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
getAtnl
in interfaceDocumentWriter
-
setAtnl
Flags is at a newline.Delegates to
setAtnl()
.- Specified by:
setAtnl
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
setAtnl
in interfaceDocumentWriter
- Returns:
this
document
-
setAtnl
Sets the at newline flag.Delegates to
setAtnl(boolean)
.- Specified by:
setAtnl
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
setAtnl
in interfaceDocumentWriter
- Returns:
this
document
-
clearAtnl
Clears the at newline flag.Delegates to
clearAtnl()
.- Specified by:
clearAtnl
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
clearAtnl
in interfaceDocumentWriter
- Returns:
this
document
-
autoNl
Performs automatic newline whenDocumentWriter.getAutonli()
and notDocumentWriter.getAtnl()
.Delegates to
autoNl()
.- Specified by:
autoNl
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
autoNl
in interfaceDocumentWriter
- Returns:
this
document- Throws:
IOException
-
autoNli
Performs automatic newline whenDocumentWriter.getAutonli()
and notDocumentWriter.getAtnl()
, followed by automatic indentation when enabled.Delegates to
autoNli()
.- Specified by:
autoNli
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
autoNli
in interfaceDocumentWriter
- Returns:
this
document- Throws:
IOException
-
autoNli
Performs automatic newline whenDocumentWriter.getAutonli()
and notDocumentWriter.getAtnl()
, followed by automatic indentation with a depth offset when enabled.Delegates to
autoNli(int)
.- Specified by:
autoNli
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
autoNli
in interfaceDocumentWriter
- 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
document- Throws:
IOException
-
autoIndent
Performs automatic indentation whenDocumentWriter.getAutonli()
,Whitespace.getIndent()
, andDocumentWriter.getAtnl()
.Delegates to
autoIndent()
.- Specified by:
autoIndent
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
autoIndent
in interfaceDocumentWriter
- Returns:
this
document- Throws:
IOException
-
autoIndent
Performs automatic indentation with a depth offset whenDocumentWriter.getAutonli()
,Whitespace.getIndent()
, andDocumentWriter.getAtnl()
.Delegates to
autoIndent(int)
.- Specified by:
autoIndent
in interfaceContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
autoIndent
in interfaceDocumentWriter
- 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
document- Throws:
IOException
-
encode
- Specified by:
encode
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
encode
in interfaceEncode
- Specified by:
encode
in interfaceText
- Returns:
this
document- Throws:
IOException
-
encode
- Specified by:
encode
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
encode
in interfaceEncode
- Specified by:
encode
in interfaceText
- Returns:
this
document- Throws:
IOException
-
encode
- Specified by:
encode
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
encode
in interfaceEncode
- Specified by:
encode
in interfaceText
- Returns:
this
document- Throws:
IOException
-
encode
- Specified by:
encode
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
encode
in interfaceEncode
- Specified by:
encode
in interfaceText
- Returns:
this
document- Throws:
IOException
-
encode
- Specified by:
encode
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
encode
in interfaceEncode
- Specified by:
encode
in interfaceText
- Returns:
this
document- Throws:
IOException
-
encode
- Specified by:
encode
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
encode
in interfaceEncode
- Specified by:
encode
in interfaceText
- Returns:
this
document- Throws:
IOException
-
encode
public <Ex extends Throwable> D encode(MediaType contentType, IOSupplierE<?, Ex> content) throws IOException, Ex- Specified by:
encode
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
encode
in interfaceEncode
- Specified by:
encode
in interfaceText
- Returns:
this
document- Throws:
IOException
Ex
-
encode
public <Ex extends Throwable> D encode(MediaType contentType, MediaWritable<Ex> content) throws IOException, Ex - Specified by:
encode
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
encode
in interfaceEncode
- Specified by:
encode
in interfaceText
- Returns:
this
document- Throws:
IOException
Ex
-
encode
- Specified by:
encode
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
encode
in interfaceEncode
- Returns:
this
document- Throws:
IOException
-
nbsp
- Specified by:
nbsp
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
nbsp
in interfaceText
- Returns:
this
document- Throws:
IOException
-
nbsp
- Specified by:
nbsp
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
nbsp
in interfaceText
- Returns:
this
document- Throws:
IOException
-
text
- Specified by:
text
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
text
in interfaceText
- Returns:
this
document- Throws:
IOException
-
text
- Specified by:
text
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
text
in interfaceText
- Returns:
this
document- Throws:
IOException
-
text
- Specified by:
text
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
text
in interfaceText
- Returns:
this
document- Throws:
IOException
-
text
- Specified by:
text
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
text
in interfaceText
- Returns:
this
document- Throws:
IOException
-
text
- Specified by:
text
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
text
in interfaceText
- Returns:
this
document- Throws:
IOException
-
text
When no knowledge of what will be written, calls
Content.clearAtnl()
to be safe.Supports translation markup type
MarkupType.XHTML
.- Specified by:
text
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
text
in interfaceText
- Returns:
this
document- Throws:
IOException
-
text
When no knowledge of what will be written, calls
Content.clearAtnl()
to be safe.Supports translation markup type
MarkupType.XHTML
.- Specified by:
text
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
text
in interfaceText
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
document- Throws:
IOException
Ex
-
text
With no knowledge of what will be written, calls
Content.clearAtnl()
to be safe.- Specified by:
text
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
text
in interfaceText
- Type Parameters:
Ex
- An arbitrary exception type that may be thrown- Returns:
this
document- Throws:
IOException
Ex
-
text
Description copied from interface:AnyTextContent
With no knowledge of what will be written, calls
Content.clearAtnl()
to be safe.- Specified by:
text
in interfaceAnyTextContent<D extends AnyDocument<D>,
D extends AnyDocument<D>> - Specified by:
text
in interfaceText
- Throws:
IOException
-
xmlDeclaration
Writes the XML declaration, if needed, using the character encoding of the encoding context.- Throws:
IOException
- See Also:
-
doctype
- Throws:
IOException
- See Also:
-