Package org.bitlet.weupnp
Class GatewayDeviceHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.bitlet.weupnp.GatewayDeviceHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
A SAX handler used to parse XML data representing a GatewayDevice
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGatewayDeviceHandler
(GatewayDevice device) Creates a new instance of GatewayDeviceHandler that will populate the fields of the supplied device -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) Receive notification of character data inside an element.void
endElement
(String uri, String localName, String qName) Receive notification of the end of an element.void
startElement
(String uri, String localName, String qName, Attributes attributes) Receive notification of the start of an element.Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, 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
declaration
-
Constructor Details
-
GatewayDeviceHandler
Creates a new instance of GatewayDeviceHandler that will populate the fields of the supplied device- Parameters:
device
- the device to configure
-
-
Method Details
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException Receive notification of the start of an element. Caches the element ascurrentElement
, and keeps track of some basic state information.- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Parameters:
uri
- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.localName
- The local name (without prefix), or the empty string if Namespace processing is not being performed.qName
- The qualified name (with prefix), or the empty string if qualified names are not available.attributes
- The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.- See Also:
-
endElement
Receive notification of the end of an element. Used to update state information.By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Parameters:
uri
- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.localName
- The local name (without prefix), or the empty string if Namespace processing is not being performed.qName
- The qualified name (with prefix), or the empty string if qualified names are not available.- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.- See Also:
-
characters
Receive notification of character data inside an element. It is used to read the values of the relevant fields of the device being configured.- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Parameters:
ch
- The characters.start
- The start position in the character array.length
- The number of characters to use from the character array.- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.- See Also:
-