public class StringSetXMLEventParser extends AbstractXMLEventParser implements Iterable<String>
| Modifier and Type | Field and Description |
|---|---|
protected QName |
elementName |
protected Set<String> |
strings |
CHARACTERS_CONTENT, fields, namespaceURI, parent| Constructor and Description |
|---|
StringSetXMLEventParser() |
StringSetXMLEventParser(String namespaceUri) |
StringSetXMLEventParser(String namespaceURI,
QName elementName)
Create a parser.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addString(String string) |
protected void |
doParseEventContent(XMLEventParserContext ctx,
XMLEvent event,
Object... args)
Parse an event's sub-elements.
|
Set<String> |
getStrings() |
Iterator<String> |
iterator() |
XMLEventParser |
newInstance()
Creates a new empty parser instance of the same type.
|
Object |
parse(XMLEventParserContext ctx,
XMLEvent listEvent,
Object... args)
Parse the event and initialize the parser's values to those found in the event.
|
allocate, doAddCharacters, doAddEventAttribute, doAddEventContent, doParseEventAttributes, freeResources, getAConstructor, getCharacters, getField, getField, getFields, getNamespaceURI, getParent, getRoot, hasField, hasField, hasFields, mergeFields, overrideFields, parseCharacterContent, removeField, setField, setField, setFields, setNamespaceURI, setParentclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic StringSetXMLEventParser()
public StringSetXMLEventParser(String namespaceUri)
public StringSetXMLEventParser(String namespaceURI, QName elementName)
namespaceURI - the namespace URI to attach to this parser. May be null.elementName - the name of the sub-elements that contain the strings.protected void addString(String string)
protected void doParseEventContent(XMLEventParserContext ctx, XMLEvent event, Object... args) throws XMLStreamException
AbstractXMLEventParserdoParseEventContent in class AbstractXMLEventParserctx - a current parser context.event - the event to parse.args - an optional list of arguments that may by used by subclasses.XMLStreamException - if an exception occurs during event-stream reading.public XMLEventParser newInstance() throws Exception
XMLEventParserXMLEventParserContext when creating parsers associated with specific event types.
The returned parser has the same namespace as the instance creating it, but has empty fields for all other
values.newInstance in interface XMLEventParsernewInstance in class AbstractXMLEventParserException - if an error or exception occurs while attempting to create the parser.public Object parse(XMLEventParserContext ctx, XMLEvent listEvent, Object... args) throws XMLStreamException
AbstractXMLEventParserparse in interface XMLEventParserparse in class AbstractXMLEventParserctx - a current parser context.listEvent - the event to parse.args - an optional list of arguments that may by used by subclasses.this, otherwise returns null.XMLStreamException - if an exception occurs during event-stream reading.