|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
edu.mit.jverbnet.util.parse.MappedHandler<java.util.List<T>>
edu.mit.jverbnet.util.parse.ListHandler<T>
public class ListHandler<T>
A mapped handler that specifically handles lists of elements.
| Field Summary |
|---|
| Fields inherited from class edu.mit.jverbnet.util.parse.MappedHandler |
|---|
messageIgnoringElementBlockExternal, messageMatcherIgnoreExternal, messageMatcherIgnoreInternal, messageParserNotSet, messageUnmappedElementBlockInternal, tagStack |
| Constructor Summary | |
|---|---|
ListHandler(IHasParserHandler parent,
java.lang.String tag,
ITaggedHandler<? extends T> elementHandler)
Creates a new CDATA handler with the specified parent and tag. |
|
ListHandler(java.lang.String tag,
ITaggedHandler<? extends T> elementHandler)
Creates a new CDATA handler with the specified tag. |
|
ListHandler(org.xml.sax.XMLReader parser,
org.xml.sax.ContentHandler parent,
java.lang.String tag,
ITaggedHandler<? extends T> elementHandler)
Creates a new CDATA handler with the specified parser, parent and tag. |
|
ListHandler(org.xml.sax.XMLReader parser,
java.lang.String tag,
ITaggedHandler<? extends T> elementHandler)
Creates a new CDATA handler with the specified parser and tag. |
|
| Method Summary | |
|---|---|
boolean |
allowsNullElements()
Returns the status of the allowNullElements flag: true if
null elements are currently allowed; false otherwise. |
void |
clearLocal()
Subclasses may override this method to add code to be invoked when MappedHandler.clear() is called. |
java.util.List<T> |
doGetElement()
If subclasses intend to use the MappedHandler.getElement() method, they should
override this method to provide the code that constructs the object
corresponding to the tagged block. |
protected void |
initHandlerMap(java.util.Map<java.lang.String,org.xml.sax.ContentHandler> map)
Adds handlers to the element map. |
void |
setAllowNullElements(boolean value)
Sets whether this handler allows null elements in its list,
or whether it will throw an exception when null elements are
encountered. |
| Methods inherited from class edu.mit.jverbnet.util.parse.MappedHandler |
|---|
checkParserSet, clear, endElement, endTaggedBlock, getDocumentLocator, getElement, getHandlerMappings, getParent, getParser, getTag, getTaggedBlockTasks, handleUnmappedEndElement, handleUnmappedStartElement, isInsideTaggedBlock, reportWarning, reportWarnings, setDocumentLocator, setParent, setParser, setReportWarnings, startElement, startTaggedBlock |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.xml.sax.ContentHandler |
|---|
characters, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startPrefixMapping |
| Constructor Detail |
|---|
public ListHandler(java.lang.String tag,
ITaggedHandler<? extends T> elementHandler)
tag - the tag for the block that this handler handles; may not be
null, empty, or all whitespace.elementHandler - the handler for the elements of the list
java.lang.NullPointerException - if the specified tag is null
java.lang.IllegalArgumentException - if the specified tag is empty or all whitespace
public ListHandler(org.xml.sax.XMLReader parser,
java.lang.String tag,
ITaggedHandler<? extends T> elementHandler)
parser - the parser for this handler; may be nulltag - the tag for the block that this handler handles; may not be
null, empty, or all whitespace.elementHandler - the handler for the elements of the list
java.lang.NullPointerException - if the specified tag is null
java.lang.IllegalArgumentException - if the specified tag is empty or all whitespace
public ListHandler(IHasParserHandler parent,
java.lang.String tag,
ITaggedHandler<? extends T> elementHandler)
parent - the parent for this handler; may be nulltag - the tag for the block that this handler handles; may not be
null, empty, or all whitespace.elementHandler - the handler for the elements of the list
java.lang.NullPointerException - if the specified tag is null
java.lang.IllegalArgumentException - if the specified tag is empty or all whitespace
public ListHandler(org.xml.sax.XMLReader parser,
org.xml.sax.ContentHandler parent,
java.lang.String tag,
ITaggedHandler<? extends T> elementHandler)
parser - the parser for this handler; may be nullparent - this handler's parent; may be nulltag - the tag for the block that this handler handles; may not be
null, empty, or all whitespace.elementHandler - the handler for the elements of the list
java.lang.NullPointerException - if the specified tag is null
java.lang.IllegalArgumentException - if the specified tag is empty or all whitespace| Method Detail |
|---|
protected void initHandlerMap(java.util.Map<java.lang.String,org.xml.sax.ContentHandler> map)
MappedHandler
initHandlerMap in class MappedHandler<java.util.List<T>>map - the map to which handlers should be addedpublic void clearLocal()
MappedHandlerMappedHandler.clear() is called.
clearLocal in class MappedHandler<java.util.List<T>>public void setAllowNullElements(boolean value)
null elements in its list,
or whether it will throw an exception when null elements are
encountered.
value - true if null elements are allowed;
false otherwisepublic boolean allowsNullElements()
true if
null elements are currently allowed; false otherwise.
true if null elements are allowed;
false otherwisepublic java.util.List<T> doGetElement()
MappedHandlerMappedHandler.getElement() method, they should
override this method to provide the code that constructs the object
corresponding to the tagged block.
doGetElement in class MappedHandler<java.util.List<T>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||