public class StringSetXMLEventParser extends AbstractXMLEventParser implements java.lang.Iterable<java.lang.String>
Modifier and Type | Field and Description |
---|---|
protected javax.xml.namespace.QName |
elementName |
protected java.util.Set<java.lang.String> |
strings |
CHARACTERS_CONTENT, fields, namespaceURI, parent
Constructor and Description |
---|
StringSetXMLEventParser() |
StringSetXMLEventParser(java.lang.String namespaceUri) |
StringSetXMLEventParser(java.lang.String namespaceURI,
javax.xml.namespace.QName elementName)
Create a parser.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addString(java.lang.String string) |
protected void |
doParseEventContent(XMLEventParserContext ctx,
javax.xml.stream.events.XMLEvent event,
java.lang.Object... args)
Parse an event's sub-elements.
|
java.util.Set<java.lang.String> |
getStrings() |
java.util.Iterator<java.lang.String> |
iterator() |
XMLEventParser |
newInstance()
Creates a new empty parser instance of the same type.
|
java.lang.Object |
parse(XMLEventParserContext ctx,
javax.xml.stream.events.XMLEvent listEvent,
java.lang.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, setParent
protected javax.xml.namespace.QName elementName
protected java.util.Set<java.lang.String> strings
public StringSetXMLEventParser()
public StringSetXMLEventParser(java.lang.String namespaceUri)
public StringSetXMLEventParser(java.lang.String namespaceURI, javax.xml.namespace.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(java.lang.String string)
protected void doParseEventContent(XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent event, java.lang.Object... args) throws javax.xml.stream.XMLStreamException
AbstractXMLEventParser
doParseEventContent
in class AbstractXMLEventParser
ctx
- a current parser context.event
- the event to parse.args
- an optional list of arguments that may by used by subclasses.javax.xml.stream.XMLStreamException
- if an exception occurs during event-stream reading.public java.util.Set<java.lang.String> getStrings()
public java.util.Iterator<java.lang.String> iterator()
iterator
in interface java.lang.Iterable<java.lang.String>
public XMLEventParser newInstance() throws java.lang.Exception
XMLEventParser
XMLEventParserContext
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 XMLEventParser
newInstance
in class AbstractXMLEventParser
java.lang.Exception
- if an error or exception occurs while attempting to create the parser.public java.lang.Object parse(XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent listEvent, java.lang.Object... args) throws javax.xml.stream.XMLStreamException
AbstractXMLEventParser
parse
in interface XMLEventParser
parse
in class AbstractXMLEventParser
ctx
- 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.javax.xml.stream.XMLStreamException
- if an exception occurs during event-stream reading.