|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nu.staldal.lsp.SimpleExtLib
public abstract class SimpleExtLib
Convenience class for implementing LSP extension libraries with only empty elements.
You only need to implement the handleElement
method and methods for any extension functions.
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 handleElement
method.
It may not do both.
Field Summary | |
---|---|
protected java.lang.Object |
extContext
External context, or null if not currently
executing a page. |
protected java.lang.String |
myNamespaceURI
Namespace URI for this extension library. |
protected java.lang.String |
pageName
Current page name, or null if not currently
executing a page. |
Constructor Summary | |
---|---|
SimpleExtLib()
|
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 |
characters(char[] chars,
int start,
int length)
|
void |
endDocument()
|
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qname)
|
void |
endPage()
Indicate the end of an LSP page. |
void |
endPrefixMapping(java.lang.String prefix)
|
abstract java.lang.String |
handleElement(java.lang.String localName,
org.xml.sax.Attributes atts,
org.xml.sax.ContentHandler out)
Handle an extension element. |
void |
ignorableWhitespace(char[] chars,
int start,
int length)
|
void |
init(java.lang.String namespaceURI)
Initialize this Extension Library. |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
|
void |
setDocumentLocator(org.xml.sax.Locator locator)
|
void |
skippedEntity(java.lang.String name)
|
void |
startDocument()
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qname,
org.xml.sax.Attributes atts)
|
void |
startPage(java.lang.Object extContext,
java.lang.String pageName)
Indicate the start of an LSP page. |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String myNamespaceURI
protected java.lang.Object extContext
null
if not currently
executing a page.
protected java.lang.String pageName
null
if not currently
executing a page.
Constructor Detail |
---|
public SimpleExtLib()
Method Detail |
---|
public void init(java.lang.String namespaceURI) throws LSPException
LSPExtLib
init
in interface LSPExtLib
namespaceURI
- the namespace URI to serve
LSPException
public void startPage(java.lang.Object extContext, java.lang.String pageName) throws LSPException
LSPExtLib
startPage
in interface LSPExtLib
extContext
- external context passed to LSP execution enginepageName
- name of the LSP page
LSPException
public org.xml.sax.ContentHandler beforeElement(org.xml.sax.ContentHandler out) throws org.xml.sax.SAXException
LSPExtLib
beforeElement
in interface LSPExtLib
out
- where to write XML output.
org.xml.sax.SAXException
- may throw SAXExceptionpublic java.lang.String afterElement() throws org.xml.sax.SAXException
LSPExtLib
afterElement
in interface LSPExtLib
org.xml.sax.SAXException
- may throw SAXExceptionpublic void endPage()
LSPExtLib
endPage
in interface LSPExtLib
public abstract java.lang.String handleElement(java.lang.String localName, org.xml.sax.Attributes atts, org.xml.sax.ContentHandler out) throws org.xml.sax.SAXException
localName
- the local name of the elementatts
- the attributes of the elementout
- where to write XML output
null
if out was used
org.xml.sax.SAXException
- may throw SAXExceptionpublic void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qname, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qname) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
startPrefixMapping
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException
endPrefixMapping
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void characters(char[] chars, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void ignorableWhitespace(char[] chars, int start, int length) throws org.xml.sax.SAXException
ignorableWhitespace
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
processingInstruction
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
skippedEntity
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |