APIdia Launch Partner
Top Description Constructors Methods
jdk.javadoc.internal.html

public abstract Class Content

extends Object
Class Inheritance
Known Direct Subclasses
jdk.javadoc.internal.html.ContentBuilder, jdk.javadoc.internal.html.Entity, jdk.javadoc.internal.html.HtmlTree, jdk.javadoc.internal.html.ListBuilder, jdk.javadoc.internal.html.RawHtml, jdk.javadoc.internal.html.Script.ScriptContent, jdk.javadoc.internal.html.Text, jdk.javadoc.internal.html.TextBuilder, jdk.javadoc.internal.doclets.formats.html.Table, jdk.javadoc.internal.doclets.formats.html.TableHeader, jdk.javadoc.internal.doclets.formats.html.markup.BodyContents, jdk.javadoc.internal.doclets.formats.html.markup.Head, jdk.javadoc.internal.html.Comment
Imports
java.io.IOException, .StringWriter, .Writer, java.util.Collection, java.util.function.Function

A content tree for javadoc output pages.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Content

Returns:

this object
add
(Content
content to be added
content
)

Adds content to the existing content.

public Content

Returns:

this object
add
(CharSequence
the string content to be added
stringContent
)

Adds a string content to the existing content.

public <T> Content

Returns:

this object
addAll
(Collection<T>
the items to be added
items
,
Function<T, Content>
the function to create content for each item
mapper
)

Adds content to the existing content, generated from a collection of items This is an optional operation.

public int

Returns:

the number of characters of plain text content in this object
charCount
()

Returns the number of characters of plain text content in this object.

public boolean

Returns:

true if this content can be discarded without affecting the output
isDiscardable
()

Returns true if this content does not affect the output and can be discarded.

public abstract boolean

Returns:

true if no content to be displayed else return false
isEmpty
()

Returns true if the content is empty.

public boolean

Returns:

true if the content is "phrasing content"
isPhrasingContent
()

Returns true if the content is "phrasing content".

public Content

Returns:

the plain text of this content with HTML tags removed
stripTags
()

Returns the plain text of this content with HTML tags removed.

public String

Returns:

string representation of the content
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the content.

public abstract boolean

Returns:

whether the writer has just written a newline
write
(Writer
the writer
writer
,
String
the newline sequence to use
newline
,
boolean
whether the writer has just written a newline
atNewline
)

Writes content to a writer, using a given newline sequence, which should be either \n or the platform line separator.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Constructor Detail

Contentback to summary
public Content()

Method Detail

addback to summary
public Content add(Content content)

Adds content to the existing content. This is an optional operation.

Implementation Specification

This implementation throws UnsupportedOperationException.

Parameters
content:Content

content to be added

Returns:Content

this object

Exceptions
UnsupportedOperationException:
if this operation is not supported by a particular implementation
IllegalArgumentException:
if the content is not suitable to be added
addback to summary
public Content add(CharSequence stringContent)

Adds a string content to the existing content. This is an optional operation.

Implementation Specification

This implementation throws UnsupportedOperationException.

Parameters
stringContent:CharSequence

the string content to be added

Returns:Content

this object

Exceptions
UnsupportedOperationException:
if this operation is not supported by a particular implementation
IllegalArgumentException:
if the content is not suitable to be added
addAllback to summary
public <T> Content addAll(Collection<T> items, Function<T, Content> mapper)

Adds content to the existing content, generated from a collection of items This is an optional operation.

Implementation Specification

This implementation delegates to add(Content).

Parameters
items:Collection<T>

the items to be added

mapper:Function<T, Content>

the function to create content for each item

Returns:Content

this object

Exceptions
UnsupportedOperationException:
if this operation is not supported by a particular implementation
IllegalArgumentException:
if the content is not suitable to be added
charCountback to summary
public int charCount()

Returns the number of characters of plain text content in this object.

Returns:int

the number of characters of plain text content in this object

isDiscardableback to summary
public boolean isDiscardable()

Returns true if this content does not affect the output and can be discarded. The default implementation considers empty content as discardable.

Returns:boolean

true if this content can be discarded without affecting the output

isEmptyback to summary
public abstract boolean isEmpty()

Returns true if the content is empty.

Returns:boolean

true if no content to be displayed else return false

isPhrasingContentback to summary
public boolean isPhrasingContent()

Returns true if the content is "phrasing content". Phrasing content is content that may appear in a paragraph, such as text, or certain HTML elements.

Returns:boolean

true if the content is "phrasing content"

See Also
Phrasing content
stripTagsback to summary
public Content stripTags()

Returns the plain text of this content with HTML tags removed.

Returns:Content

the plain text of this content with HTML tags removed

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of the content. Newlines are represented by \n.

Returns:String

string representation of the content

Annotations
@Override
writeback to summary
public abstract boolean write(Writer writer, String newline, boolean atNewline) throws IOException

Writes content to a writer, using a given newline sequence, which should be either \n or the platform line separator.

Parameters
writer:Writer

the writer

newline:String

the newline sequence to use

atNewline:boolean

whether the writer has just written a newline

Returns:boolean

whether the writer has just written a newline

Exceptions
IOException:
if an error occurs while writing the output