public abstract class

OwsItem

extends Object
java.lang.Object
   ↳ com.esri.core.ogc.OwsItem
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

This class provides basic support for parsing OGC Web Service based XML documents. Generally subclasses of this class should be set up to parse a particular XML element when startElement(String, Attributes) is called. This could be the creation a some class that represents an XML element or could simply be the setting of a flag to give some context to subsequent calls to characters and endEleement. Any relevant XML attributes should be retained here. Any text associated with the element will be read by calls to characters(char[], int, int). When endElement(String) is called, the subclass should carry out any processing required using saved XML attributes and any associated text.

Summary

Fields
protected StringBuilder mData
protected Stack<String> mStack
Public Constructors
OwsItem()
Public Methods
void characters(char[] ch, int start, int length)
Called whenever there is any text associated with an element (rather than its attributes).
void endElement(String localName)
This method is called when we reach the end of the XML element with the given name.
void startElement(String localName, Attributes atts)
This method is called to start processing the XML element with the given name.
Protected Methods
String getCurrentTagName()
Used to get the name of the XML element currently being processed.
int getStackSize()
Used to get the number of items currently in the stack of XML element names.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected StringBuilder mData

protected Stack<String> mStack

Public Constructors

public OwsItem ()

Public Methods

public void characters (char[] ch, int start, int length)

Called whenever there is any text associated with an element (rather than its attributes). Note that this method may be called repeatedly for any particular element so any text here will be appended to the end of the previous text.

Parameters
ch char: characters to process
start int: start point of text relevant to this call
length int: length of text

public void endElement (String localName)

This method is called when we reach the end of the XML element with the given name. Note that this method will be called for subsequent child elements as well as sibling elements. Use the contents of the stack to determine where we are in the XML being parsed.

Parameters
localName String: name of XML element that we have reached the end of

public void startElement (String localName, Attributes atts)

This method is called to start processing the XML element with the given name. Any attributes of the element are provided here. Any text contained within the element will be available on the next call to characters(char[], int, int).

Parameters
localName String
atts Attributes: attributes of the current element, if any

Protected Methods

protected String getCurrentTagName ()

Used to get the name of the XML element currently being processed.

Returns
String the name of the XML element currently being processed

protected int getStackSize ()

Used to get the number of items currently in the stack of XML element names. Gives some indication of where we are in nested XML elements.

Returns
int current number of XML element names in the stack