All Downloads are FREE. Search and download functionalities are using the official Maven repository.

doc.api.au.id.jericho.lib.html.IOutputSegment.html Maven / Gradle / Ivy

Go to download

Jericho HTML Parser is a simple but powerful java library allowing analysis and manipulation of parts of an HTML document, including some common server-side tags, while reproducing verbatim any unrecognised or invalid HTML. It also provides high-level HTML form manipulation functions.

There is a newer version: 2.3
Show newest version






IOutputSegment (Jericho HTML Parser 1.5-dev1)

















au.id.jericho.lib.html
Interface IOutputSegment

All Known Implementing Classes:
AttributesOutputSegment, BlankOutputSegment, CharOutputSegment, StringOutputSegment

public interface IOutputSegment

Defines the interface for an output segment, which is used in an OutputDocument to replace segments of the source document with other text.

All text in the OutputDocument between the character positions defined by getBegin() and getEnd() is replaced by the content of this output segment. If the begin and end character positions are the same, the content is simply inserted at this position without replacing any text.

See Also:
OutputDocument

Field Summary
static java.util.Comparator COMPARATOR
          The comparator used to sort output segments in the OutputDocument.
 
Method Summary
 int getBegin()
          Returns the character position in the OutputDocument where this segment begins.
 java.lang.String getDebugInfo()
          Returns a string representation of this object useful for debugging purposes.
 int getEnd()
          Returns the character position in the OutputDocument where this segment ends.
 void output(java.io.Writer writer)
          Outputs the content of this output segment to the specified Writer.
 java.lang.String toString()
          Returns the content of this output segment as a String.
 

Field Detail

COMPARATOR

public static final java.util.Comparator COMPARATOR
The comparator used to sort output segments in the OutputDocument.

Method Detail

getBegin

public int getBegin()
Returns the character position in the OutputDocument where this segment begins.

Returns:
the character position in the OutputDocument where this segment begins.

getEnd

public int getEnd()
Returns the character position in the OutputDocument where this segment ends.

Returns:
the character position in the OutputDocument where this segment ends.

output

public void output(java.io.Writer writer)
            throws java.io.IOException
Outputs the content of this output segment to the specified Writer.

Parameters:
writer - the Writer to which the output is to be sent.
Throws:
java.io.IOException - if an I/O exception occurs.

toString

public java.lang.String toString()
Returns the content of this output segment as a String.

Note that before version 1.5 this returned a representation of this object useful for debugging purposes, which can now be obtained via the getDebugInfo() method.

Returns:
the content of this output segment as a String.
See Also:
output(Writer)

getDebugInfo

public java.lang.String getDebugInfo()
Returns a string representation of this object useful for debugging purposes.

Returns:
a string representation of this object useful for debugging purposes.






© 2015 - 2024 Weber Informatics LLC | Privacy Policy