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

public Class Text

extends Content
Class Inheritance
Imports
java.io.IOException, .Writer

Class for containing immutable string content for HTML tags of javadoc output. Newlines are always represented by \n. Any special HTML characters will be escaped if and when the content is written out.

Field Summary

Modifier and TypeField and Description
public static final Text
public static final String
NL

The newline character, to be used when creating Content nodes.

private final String

Constructor Summary

AccessConstructor and Description
private
Text(CharSequence
content for the object
content
)

Constructs an immutable text object.

Method Summary

Modifier and TypeMethod and Description
public int
charCount()

Overrides jdk.javadoc.internal.html.Content.charCount.

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

pack-priv static int
pack-priv static boolean

Returns:

true if there are no \r characters, and false otherwise
checkNewlines
(CharSequence
the characters to be checked
cs
)

Check for the absence of \r characters.

public boolean
isEmpty()

Implements abstract jdk.javadoc.internal.html.Content.isEmpty.

Returns true if the content is empty.

public boolean
isPhrasingContent()

Overrides jdk.javadoc.internal.html.Content.isPhrasingContent.

Returns true if the content is "phrasing content".

public static CharSequence

Returns:

the string with newlines in the form \n
normalizeNewlines
(CharSequence
the string
text
)

Returns a given string with all newlines in the form \n.

public static Text

Returns:

the object
of
(CharSequence
the text content
content
)

Creates a new object containing immutable text.

public String
toString()

Overrides jdk.javadoc.internal.html.Content.toString.

Returns a string representation of the content.

public boolean
write(Writer out, String newline, boolean atNewline)

Implements abstract jdk.javadoc.internal.html.Content.write.

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

Inherited from jdk.javadoc.internal.html.Content:
addaddaddAllisDiscardablestripTags

Field Detail

EMPTYback to summary
public static final Text EMPTY
NLback to summary
public static final String NL

The newline character, to be used when creating Content nodes.

stringback to summary
private final String string

Constructor Detail

Textback to summary
private Text(CharSequence content)

Constructs an immutable text object.

Parameters
content:CharSequence

content for the object

Method Detail

charCountback to summary
public int charCount()

Overrides jdk.javadoc.internal.html.Content.charCount.

Doc from jdk.javadoc.internal.html.Content.charCount.

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

Annotations
@Override
charCountback to summary
pack-priv static int charCount(CharSequence cs)
checkNewlinesback to summary
pack-priv static boolean checkNewlines(CharSequence cs)

Check for the absence of \r characters.

Parameters
cs:CharSequence

the characters to be checked

Returns:boolean

true if there are no \r characters, and false otherwise

isEmptyback to summary
public boolean isEmpty()

Implements abstract jdk.javadoc.internal.html.Content.isEmpty.

Doc from jdk.javadoc.internal.html.Content.isEmpty.

Returns true if the content is empty.

Annotations
@Override
isPhrasingContentback to summary
public boolean isPhrasingContent()

Overrides jdk.javadoc.internal.html.Content.isPhrasingContent.

Doc from jdk.javadoc.internal.html.Content.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.

Annotations
@Override
normalizeNewlinesback to summary
public static CharSequence normalizeNewlines(CharSequence text)

Returns a given string with all newlines in the form \n. The sequences of interest are \n, \r\n, and \r. \n is already in the right form, so can be ignored, leaving code to handle \r\n, and \r.

Parameters
text:CharSequence

the string

Returns:CharSequence

the string with newlines in the form \n

ofback to summary
public static Text of(CharSequence content)

Creates a new object containing immutable text.

Parameters
content:CharSequence

the text content

Returns:Text

the object

toStringback to summary
public String toString()

Overrides jdk.javadoc.internal.html.Content.toString.

Doc from jdk.javadoc.internal.html.Content.toString.

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

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

Implements abstract jdk.javadoc.internal.html.Content.write.

Doc from jdk.javadoc.internal.html.Content.write.

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

Annotations
@Override
Exceptions
IOException:
if an error occurs while writing the output