|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.stax.StAXContentHandlerBase net.sf.stax.BooleanElementHandler
public final class BooleanElementHandler
StAX handler for any element which just contains a string
representation of a boolean. The boolean value, returned by
the endTree(StAXContext)
method, is available
to a parent handler via its endElement(String, String,
String, Object, StAXContext)
method.
Ex.
class MyHandler extends StAXContentHandlerBase { private Boolean booleanValue; private BooleanElementHandler booleanHandler = new BooleanElementHandler(); public void startElement(..., StAXDelegationContext dctx) { // ... dctx.delegate(booleanHandler); } public void endElement(..., Object result, ...) { this.booleanValue = (Boolean) result; } }
StAXContentHandlers.getBooleanElementHandler()
Field Summary |
---|
Fields inherited from interface net.sf.stax.StAXContentHandler |
---|
IGNORE |
Constructor Summary | |
---|---|
BooleanElementHandler()
|
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length,
StAXContext ctx)
Receive notification of character data. |
void |
endElement(String nsURI,
String localName,
String qName,
Object result,
StAXContext ctx)
Receive notification of the end of an element. |
Object |
endTree(StAXContext ctx)
Receive notification of the end of a sub-tree of a document. |
void |
startElement(String nsURI,
String localName,
String qName,
Attributes attrs,
StAXDelegationContext dctx)
Receive notification of the beginning of an element. |
Methods inherited from class net.sf.stax.StAXContentHandlerBase |
---|
endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, startTree |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BooleanElementHandler()
Method Detail |
---|
public void startElement(String nsURI, String localName, String qName, Attributes attrs, StAXDelegationContext dctx) throws SAXException
StAXContentHandler
startElement
in interface StAXContentHandler
startElement
in class StAXContentHandlerBase
nsURI
- namespace URIlocalName
- local name (without prefix)qName
- qualified XML name (with prefix)attrs
- attributes attached to the elementdctx
- StAX delegation context
SAXException
- any SAX exception, possibly wrapping another exceptionStAXContentHandler
public void endElement(String nsURI, String localName, String qName, Object result, StAXContext ctx) throws SAXException
StAXContentHandler
endElement
in interface StAXContentHandler
endElement
in class StAXContentHandlerBase
nsURI
- namespace URIlocalName
- local name (without prefix)qName
- qualified XML name (with prefix)result
- resultctx
- StAX context
SAXException
- any SAX exception, possibly wrapping another exceptionStAXContentHandler
public void characters(char[] ch, int start, int length, StAXContext ctx) throws SAXException
StAXContentHandler
characters
in interface StAXContentHandler
characters
in class StAXContentHandlerBase
ch
- characters from the XML documentstart
- start position in the arraylength
- number of characters to read from the arrayctx
- StAX context
SAXException
- any SAX exception, possibly wrapping another exceptionStAXContentHandler
public Object endTree(StAXContext ctx) throws SAXException
StAXContentHandler
endTree
in interface StAXContentHandler
endTree
in class StAXContentHandlerBase
ctx
- StAX context
SAXException
- any SAX exception, possibly wrapping another exceptionStAXContentHandler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |