|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LSPExtLib
LSP Extension Library.
After instance creation, the init method will be invoked with the namespace URI. This allows the same class to be used for several namespaces.
An LSPExtLib may be reused, but will not be executed concurrently by several threads.
For each LSP page to process, the startPage method will be invoked first. Then for each extension element on the LSP page:
The extlib can return data in one of two ways, write to the supplied ContentHandler "out" (it must not invoke startDocument() or endDocument()), or return a string from the afterElement() method. It may not do both.
For each call to an extension function, a method with the function name prefixed with '_' is invoked. All arguments to this method must be of type Object, and the return type must be Object, it may throw SAXException. Functions may be overloaded based on number of arguments.
After the LSP page is finished, the endPage method is invoked.
An easier, but not as flexible, way to implement an extension library is to extend the
SimpleExtLib
class.
Method Summary | |
---|---|
java.lang.String |
afterElement()
Invoked after the element is sent. |
org.xml.sax.ContentHandler |
beforeElement(org.xml.sax.ContentHandler out)
Invoked before the element is sent. |
void |
endPage()
Indicate the end of an LSP page. |
void |
init(java.lang.String namespaceURI)
Initialize this Extension Library. |
void |
startPage(java.lang.Object extContext,
java.lang.String pageName)
Indicate the start of an LSP page. |
Method Detail |
---|
void init(java.lang.String namespaceURI) throws org.xml.sax.SAXException
namespaceURI
- the namespace URI to serve
org.xml.sax.SAXException
- may throw SAXExceptionvoid startPage(java.lang.Object extContext, java.lang.String pageName) throws org.xml.sax.SAXException
extContext
- external context passed to LSP execution enginepageName
- name of the LSP page
org.xml.sax.SAXException
- may throw SAXExceptionorg.xml.sax.ContentHandler beforeElement(org.xml.sax.ContentHandler out) throws org.xml.sax.SAXException
out
- where to write XML output.
org.xml.sax.SAXException
- may throw SAXExceptionjava.lang.String afterElement() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- may throw SAXExceptionvoid endPage() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- may throw SAXException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |