|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sapportals.wcm.util.html.HTMLFilterImpl
Default Implementation of IHTMLFilter.
Provides a default implmentation which is the null filter. It forwards all events unchanged to its content handler.
Filters only interested in a subset of the events can extend this class to ease their implementation effort.
Copyright (c) SAP AG 2001-2002
| Constructor Summary | |
HTMLFilterImpl()
Empty filter with a parent reader installed. |
|
HTMLFilterImpl(IHTMLReader reader)
Filter which receives its events from the given reader. |
|
| Method Summary | |
void |
characters(char[] ch,
int start,
int length)
Notification of a character event. |
void |
discard()
Free all allocated resources. |
void |
endDocument()
Notification that the document is finished. |
void |
endElement(IHTMLElement element)
Notification that an end tag was encountered (e.g. starting with '</'). |
void |
endTextDocument()
Notification that the document is finished. |
IHTMLContentHandler |
getContentHandler()
Get the registered content handler. |
String |
getEncoding()
Return the encoding used in the document. |
IHTMLReader |
getParent()
Get the reader this filter gets its events from. |
ITextContentHandler |
getRawContentHandler()
Get the registered raw content handler. |
void |
parse()
Parse the complete document, generating events, until the source is read emtpy. |
boolean |
parseNextEvent()
Parse the document, generating an events, and return to the caller. |
void |
setContentHandler(IHTMLContentHandler handler)
Set the content handler to a new value. |
void |
setParent(IHTMLReader reader)
Set the reader where this filter should get its events from. |
void |
setRawContentHandler(ITextContentHandler handler)
Set the content handler to a new value. |
void |
setSource(InputStream input)
Set InputStream as document source. |
void |
setSource(InputStream input,
String encoding)
Set InputStream as document source, use the given encoding. |
void |
setSource(Reader input)
Set Reader as document source, encoding is irrelevant. |
void |
startDocument()
Notification that the document is about to start. |
void |
startElement(IHTMLElementStart element)
Notification that a tag was encountered. |
void |
startTextDocument()
Notification that the document is about to start. |
void |
textCharacters(char[] buffer,
int start,
int len)
Notification of a character event. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HTMLFilterImpl()
public HTMLFilterImpl(IHTMLReader reader)
reader - to get events from| Method Detail |
public IHTMLReader getParent()
IHTMLFilter
getParent in interface IHTMLFilterpublic void setParent(IHTMLReader reader)
IHTMLFilter
setParent in interface IHTMLFilterreader - new parent readerpublic IHTMLContentHandler getContentHandler()
IHTMLReadernull if none is
installed.
getContentHandler in interface IHTMLReaderpublic ITextContentHandler getRawContentHandler()
IHTMLReadernull if none is
installed.
getRawContentHandler in interface IHTMLReader
public void setSource(InputStream input)
throws HTMLException,
IOException
IHTMLReader
setSource in interface IHTMLReaderinput - stream to read document from
IOException - on read errors
HTMLException - when document is not legal HTML
public void setSource(InputStream input,
String encoding)
throws HTMLException,
IOException
IHTMLReader
setSource in interface IHTMLReaderinput - stream to read document fromencoding - to use for stream
IOException - on read errors
HTMLException - when document is not legal HTML
public void setSource(Reader input)
throws HTMLException,
IOException
IHTMLReader
setSource in interface IHTMLReaderinput - to read document from
IOException - on read errors
HTMLException - when document is not legal HTMLpublic void setContentHandler(IHTMLContentHandler handler)
IHTMLReadernull is allowed to
deregister an installed handler.
setContentHandler in interface IHTMLReaderhandler - to registerpublic void setRawContentHandler(ITextContentHandler handler)
IHTMLReadernull is allowed to
deregister an installed handler.
setRawContentHandler in interface IHTMLReaderhandler - to register
public String getEncoding()
throws HTMLException,
IOException
IHTMLReader
getEncoding in interface IHTMLReadernull if unknown.
IOException - on read errors
HTMLException - when document is not legal HTML
public void parse()
throws HTMLException,
IOException
IHTMLReader
parse in interface IHTMLReaderHTMLException - when document is not legal HTML
IOException - on read errors
public boolean parseNextEvent()
throws HTMLException,
IOException
IHTMLReader
parseNextEvent in interface IHTMLReaderIOException - on read errors
HTMLException - when document is not legal HTMLpublic void discard()
IHTMLReader
discard in interface IHTMLReader
public void characters(char[] ch,
int start,
int length)
throws HTMLException
IHTMLContentHandlerch at offset start . There are length
number of characters.
The content of the buffer before start or after start +
length is undefined. Modification of the character array is strictly
forbidden. The content of the array is undefined after this method returns.
characters in interface IHTMLContentHandlerch - array holding characters of eventstart - where in the array the characters beginlength - number of characters in event
HTMLException - to indicate error in event handling
public void endDocument()
throws HTMLException
IHTMLContentHandler
endDocument in interface IHTMLContentHandlerHTMLException - to indicate error in event handling
public void endElement(IHTMLElement element)
throws HTMLException
IHTMLContentHandlerIHTMLElement for further information.
endElement in interface IHTMLContentHandlerelement - TBD: Description of the incoming method parameter
HTMLException - to indicate error in event handling
public void startDocument()
throws HTMLException
IHTMLContentHandler
startDocument in interface IHTMLContentHandlerHTMLException - to indicate error in event handling
public void startElement(IHTMLElementStart element)
throws HTMLException
IHTMLContentHandlerIHTMLElementStart for further information.
startElement in interface IHTMLContentHandlerelement - TBD: Description of the incoming method parameter
HTMLException - to indicate error in event handling
public void startTextDocument()
throws IOException
ITextContentHandler
startTextDocument in interface ITextContentHandlerIOException - to indicate error in event handling
public void endTextDocument()
throws IOException
ITextContentHandler
endTextDocument in interface ITextContentHandlerIOException - to indicate error in event handling
public void textCharacters(char[] buffer,
int start,
int len)
throws IOException
ITextContentHandlerch at offset start . There are length
number of characters.
The content of the buffer before start or after start +
length is undefined. Modification of the character array is strictly
forbidden. The content of the array is undefined after this method returns.
textCharacters in interface ITextContentHandlerbuffer - array holding characters of eventstart - where in the array the characters beginlen - number of characters in event
IOException - to indicate error in event handling
|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||