|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.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 '</'). |
IHTMLContentHandler |
getContentHandler()
Get the registered content handler. |
java.lang.String |
getEncoding()
Return the encoding used in the document. |
IHTMLReader |
getParent()
Get the reader this filter gets its events from. |
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 |
setSource(java.io.InputStream input)
Set InputStream as document source. |
void |
setSource(java.io.InputStream input,
java.lang.String encoding)
Set InputStream as document source, use the given encoding. |
void |
setSource(java.io.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. |
| 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()
IHTMLFiltergetParent in interface IHTMLFiltercom.sapportals.wcm.util.html.IHTMLFilterpublic void setParent(IHTMLReader reader)
IHTMLFiltersetParent in interface IHTMLFiltercom.sapportals.wcm.util.html.IHTMLFilterreader - new parent readerpublic IHTMLContentHandler getContentHandler()
IHTMLReadernull if none is
installed.getContentHandler in interface IHTMLReadercom.sapportals.wcm.util.html.IHTMLReader
public void setSource(java.io.InputStream input)
throws HTMLException,
java.io.IOException
IHTMLReadersetSource in interface IHTMLReadercom.sapportals.wcm.util.html.IHTMLReaderinput - stream to read document fromHTMLException - when document is not legal HTMLjava.io.IOException - on read errors
public void setSource(java.io.InputStream input,
java.lang.String encoding)
throws HTMLException,
java.io.IOException
IHTMLReadersetSource in interface IHTMLReadercom.sapportals.wcm.util.html.IHTMLReaderinput - stream to read document fromencoding - to use for streamHTMLException - when document is not legal HTMLjava.io.IOException - on read errors
public void setSource(java.io.Reader input)
throws HTMLException,
java.io.IOException
IHTMLReadersetSource in interface IHTMLReadercom.sapportals.wcm.util.html.IHTMLReaderinput - to read document fromHTMLException - when document is not legal HTMLjava.io.IOException - on read errorspublic void setContentHandler(IHTMLContentHandler handler)
IHTMLReadernull is allowed to
deregister an installed handler.setContentHandler in interface IHTMLReadercom.sapportals.wcm.util.html.IHTMLReaderhandler - to register
public java.lang.String getEncoding()
throws HTMLException,
java.io.IOException
IHTMLReadergetEncoding in interface IHTMLReadercom.sapportals.wcm.util.html.IHTMLReadernull if unknown.HTMLException - when document is not legal HTMLjava.io.IOException - on read errors
public void parse()
throws HTMLException,
java.io.IOException
IHTMLReaderparse in interface IHTMLReadercom.sapportals.wcm.util.html.IHTMLReaderHTMLException - when document is not legal HTMLjava.io.IOException - on read errors
public boolean parseNextEvent()
throws HTMLException,
java.io.IOException
IHTMLReaderparseNextEvent in interface IHTMLReadercom.sapportals.wcm.util.html.IHTMLReaderHTMLException - when document is not legal HTMLjava.io.IOException - on read errorspublic void discard()
IHTMLReaderdiscard 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 IHTMLContentHandlercom.sapportals.wcm.util.html.IHTMLContentHandlerch - array holding characters of eventstart - where in the array the characters beginlength - number of characters in eventHTMLException - to indicate error in event handling
public void endDocument()
throws HTMLException
IHTMLContentHandlerendDocument in interface IHTMLContentHandlercom.sapportals.wcm.util.html.IHTMLContentHandlerHTMLException - to indicate error in event handling
public void endElement(IHTMLElement element)
throws HTMLException
IHTMLContentHandlerIHTMLElement for further information.endElement in interface IHTMLContentHandlercom.sapportals.wcm.util.html.IHTMLContentHandlerelement - TBD: Description of the incoming method parameterHTMLException - to indicate error in event handling
public void startDocument()
throws HTMLException
IHTMLContentHandlerstartDocument in interface IHTMLContentHandlercom.sapportals.wcm.util.html.IHTMLContentHandlerHTMLException - to indicate error in event handling
public void startElement(IHTMLElementStart element)
throws HTMLException
IHTMLContentHandlerIHTMLElementStart for further information.startElement in interface IHTMLContentHandlercom.sapportals.wcm.util.html.IHTMLContentHandlerelement - TBD: Description of the incoming method parameterHTMLException - to indicate error in event handling
|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||