All Packages Class Hierarchy This Package Previous Next Index
Class websphinx.HTMLTransformer
java.lang.Object
|
+----websphinx.HTMLTransformer
- public class HTMLTransformer
- extends Object
-
HTMLTransformer(HTMLTransformer)
- Make an HTMLTransformer that writes pages to a
downstream HTMLTransformer.
-
HTMLTransformer(OutputStream)
- Make an HTMLTransformer that writes pages to a
stream.
-
HTMLTransformer(String)
- Make an HTMLTransformer that writes pages to a
file.
-
HTMLTransformer(String, boolean)
- Make an HTMLTransformer that writes pages to a
file.
-
HTMLTransformer(Writer)
- Make an HTMLTransformer that writes pages to a
stream.
-
close()
- Close the transformer.
-
emit(Region)
- Emit a region on the transformer chain's final output.
-
emit(String)
- Emit a string on the transformer chain's final output.
-
finalize()
- Finalizes the transformer (calling close()).
-
flush()
- Flushes transformer to its destination stream.
-
getFilePointer()
- Get the file pointer.
-
getOutput()
-
-
getRandomAccessFile()
-
-
handleElement(Element)
- Handle the transformation of an HTML element.
-
seek(long)
- Seek to a file position.
-
setOutput(OutputStream)
-
-
setOutput(Writer)
-
-
setRandomAccessFile(RandomAccessFile)
-
-
transformContents(Element)
- Transform the contents of an element.
-
transformElement(Element)
- Transform an element by passing it through the entire
filter chain.
-
write(Region)
- Writes a chunk of HTML through the HTML transformer.
-
write(String)
- Writes a literal string through the HTML transformer
(without parsing it or transforming it).
-
writePage(Page)
- Writes a page through the HTML transformer.
HTMLTransformer
public HTMLTransformer(OutputStream out)
- Make an HTMLTransformer that writes pages to a
stream.
- Parameters:
- out - Stream to receive HTML output
HTMLTransformer
public HTMLTransformer(String filename) throws IOException
- Make an HTMLTransformer that writes pages to a
file.
- Parameters:
- filename - Name of file to receive HTML output
- Throws: IOException
- if file cannot be opened
HTMLTransformer
public HTMLTransformer(String filename,
boolean seekable) throws IOException
- Make an HTMLTransformer that writes pages to a
file.
- Parameters:
- filename - Name of file to receive HTML output
- seekable - True if file should be opened for random access
HTMLTransformer
public HTMLTransformer(Writer stream)
- Make an HTMLTransformer that writes pages to a
stream.
- Parameters:
- stream - Stream to receive HTML output
HTMLTransformer
public HTMLTransformer(HTMLTransformer next)
- Make an HTMLTransformer that writes pages to a
downstream HTMLTransformer. Use this constructor
to chain together several HTMLTransformers.
- Parameters:
- next - HTMLTransformer to receive HTML output
setOutput
public void setOutput(OutputStream out)
setOutput
public void setOutput(Writer out)
getOutput
public Writer getOutput()
setRandomAccessFile
public void setRandomAccessFile(RandomAccessFile raf)
getRandomAccessFile
public RandomAccessFile getRandomAccessFile()
write
public synchronized void write(String string) throws IOException
- Writes a literal string through the HTML transformer
(without parsing it or transforming it).
- Parameters:
- string - String to write
write
public synchronized void write(Region region) throws IOException
- Writes a chunk of HTML through the HTML transformer.
- Parameters:
- region - Region to write
writePage
public synchronized void writePage(Page page) throws IOException
- Writes a page through the HTML transformer.
- Parameters:
- page - Page to write
flush
public synchronized void flush() throws IOException
- Flushes transformer to its destination stream.
Empties any buffers in the transformer chain.
close
public synchronized void close() throws IOException
- Close the transformer. Flushes all buffered data
to disk by calling flush(). This call may be
time-consuming! Don't use the transformer again after
closing it.
- Throws: IOException
- if an I/O error occurs
finalize
protected void finalize() throws Throwable
- Finalizes the transformer (calling close()).
- Overrides:
- finalize in class Object
getFilePointer
public long getFilePointer() throws IOException
- Get the file pointer.
- Returns:
- current file pointer
- Throws: IOException
- if this transformer not opened for random access
seek
public void seek(long pos) throws IOException
- Seek to a file position.
- Parameters:
- pos - file position to seek
- Throws: IOException
- if this transformer not opened for random access
transformElement
protected void transformElement(Element elem) throws IOException
- Transform an element by passing it through the entire
filter chain.
- Parameters:
- elem - Element to be transformed
transformContents
protected void transformContents(Element elem) throws IOException
- Transform the contents of an element. Passes
the child elements through the filter chain
and emits the text between them.
- Parameters:
- elem - Element whose contents should be transformed
handleElement
protected void handleElement(Element elem) throws IOException
- Handle the transformation of an HTML element.
Override this method to modify the HTML as it is
written.
- Parameters:
- elem - Element to transform
emit
protected void emit(Region r) throws IOException
- Emit a region on the transformer chain's final output.
(The region isn't passed through the chain.)
- Parameters:
- r - Region to emit
emit
protected void emit(String string) throws IOException
- Emit a string on the transformer chain's final output.
- Parameters:
- string - String to emit
All Packages Class Hierarchy This Package Previous Next Index