Package org.bitlet.weupnp
Class GatewayDeviceHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.bitlet.weupnp.GatewayDeviceHandler
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler,org.xml.sax.DTDHandler,org.xml.sax.EntityResolver,org.xml.sax.ErrorHandler
public class GatewayDeviceHandler extends org.xml.sax.helpers.DefaultHandlerA SAX handler used to parse XML data representing a GatewayDevice- See Also:
DefaultHandler
-
-
Constructor Summary
Constructors Constructor Description GatewayDeviceHandler(GatewayDevice device)Creates a new instance of GatewayDeviceHandler that will populate the fields of the supplied device
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Receive notification of character data inside an element.voidendElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)Receive notification of the end of an element.voidstartElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)Receive notification of the start of an element.
-
-
-
Constructor Detail
-
GatewayDeviceHandler
public GatewayDeviceHandler(GatewayDevice device)
Creates a new instance of GatewayDeviceHandler that will populate the fields of the supplied device- Parameters:
device- the device to configure
-
-
Method Detail
-
startElement
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXExceptionReceive notification of the start of an element. Caches the element ascurrentElement, and keeps track of some basic state information.- Specified by:
startElementin interfaceorg.xml.sax.ContentHandler- Overrides:
startElementin classorg.xml.sax.helpers.DefaultHandler- 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:
org.xml.sax.SAXException- Any SAX exception, possibly wrapping another exception.- See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXExceptionReceive 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:
endElementin interfaceorg.xml.sax.ContentHandler- Overrides:
endElementin classorg.xml.sax.helpers.DefaultHandler- 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:
org.xml.sax.SAXException- Any SAX exception, possibly wrapping another exception.- See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXExceptionReceive 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:
charactersin interfaceorg.xml.sax.ContentHandler- Overrides:
charactersin classorg.xml.sax.helpers.DefaultHandler- Parameters:
ch- The characters.start- The start position in the character array.length- The number of characters to use from the character array.- Throws:
org.xml.sax.SAXException- Any SAX exception, possibly wrapping another exception.- See Also:
ContentHandler.characters(char[], int, int)
-
-