NASA World Wind

gov.nasa.worldwind.util.xml
Class StringSetXMLEventParser

java.lang.Object
  extended by gov.nasa.worldwind.util.xml.AbstractXMLEventParser
      extended by gov.nasa.worldwind.util.xml.StringSetXMLEventParser
All Implemented Interfaces:
XMLEventParser, Iterable<String>

public class StringSetXMLEventParser
extends AbstractXMLEventParser
implements Iterable<String>

Parses a list of XML strings.


Field Summary
protected  QName elementName
           
protected  Set<String> strings
           
 
Fields inherited from class gov.nasa.worldwind.util.xml.AbstractXMLEventParser
CHARACTERS_CONTENT, fields, namespaceURI, parent
 
Constructor Summary
StringSetXMLEventParser()
           
StringSetXMLEventParser(String namespaceUri)
           
StringSetXMLEventParser(String namespaceURI, QName elementName)
          Create a parser.
 
Method Summary
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()
           
 Object parse(XMLEventParserContext ctx, XMLEvent listEvent, Object... args)
          Parse the event and initialize the parser's values to those found in the event.
 
Methods inherited from class gov.nasa.worldwind.util.xml.AbstractXMLEventParser
allocate, doAddCharacters, doAddEventAttribute, doAddEventContent, doParseEventAttributes, freeResources, getAConstructor, getCharacters, getField, getField, getFields, getNamespaceURI, getParent, getRoot, hasField, hasField, hasFields, mergeFields, newInstance, overrideFields, parseCharacterContent, removeField, setField, setField, setFields, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elementName

protected QName elementName

strings

protected Set<String> strings
Constructor Detail

StringSetXMLEventParser

public StringSetXMLEventParser()

StringSetXMLEventParser

public StringSetXMLEventParser(String namespaceUri)

StringSetXMLEventParser

public StringSetXMLEventParser(String namespaceURI,
                               QName elementName)
Create a parser. All sub-elements of a specified name are parsed as strings and retained.

Parameters:
namespaceURI - the namespace URI to attach to this parser. May be null.
elementName - the name of the sub-elements that contain the strings.
Method Detail

addString

protected void addString(String string)

doParseEventContent

protected void doParseEventContent(XMLEventParserContext ctx,
                                   XMLEvent event,
                                   Object... args)
                            throws XMLStreamException
Description copied from class: AbstractXMLEventParser
Parse an event's sub-elements.

Overrides:
doParseEventContent in class AbstractXMLEventParser
Parameters:
ctx - a current parser context.
event - the event to parse.
args - an optional list of arguments that may by used by subclasses.
Throws:
XMLStreamException - if an exception occurs during event-stream reading.

getStrings

public Set<String> getStrings()

iterator

public Iterator<String> iterator()
Specified by:
iterator in interface Iterable<String>

parse

public Object parse(XMLEventParserContext ctx,
                    XMLEvent listEvent,
                    Object... args)
             throws XMLStreamException
Description copied from class: AbstractXMLEventParser
Parse the event and initialize the parser's values to those found in the event.

Specified by:
parse in interface XMLEventParser
Overrides:
parse in class AbstractXMLEventParser
Parameters:
ctx - a current parser context.
listEvent - the event to parse.
args - an optional list of arguments that may by used by subclasses.
Returns:
if parsing is successful, returns this, otherwise returns null.
Throws:
XMLStreamException - if an exception occurs during event-stream reading.

NASA World Wind