public abstract class XMLHandler
extends org.xml.sax.helpers.DefaultHandler
DefaultHandler,
ServerXMLHandler,
ClientXMLHandler| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap<java.lang.String,java.lang.String> |
attr |
private java.lang.StringBuffer |
data |
private Tag.TType |
type |
private static java.lang.String |
version |
| Constructor and Description |
|---|
XMLHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] arg0,
int arg1,
int arg2) |
java.awt.Color |
convertToColor(java.lang.String strC)
Converts 8 character string representation of a 32-bit Integer in hex
into a color with RGBA content
|
void |
endDocument() |
protected abstract void |
endOfXMLDocument()
Method is called when root tag is closed
|
protected java.lang.String |
getData()
Supplemental tag to get the content of non empty element
|
private java.lang.String |
getFromXMLStr(java.lang.String inStr)
Inside function used for converting "&" to '&',
"<" to '<' and "" to '"' inside
the string for converting XML ready text to user eye friendly.
|
protected Tag.TType |
getType()
Supplemental method to get the type of parsing tag
|
java.lang.String |
getVersion()
Returns the version of the communication language between client and
server in NetPuzl world.
|
protected java.awt.image.BufferedImage |
parseHexImage(java.lang.String imStr)
Method for converting hex string into image
|
protected abstract Tag |
parseTag()
Parses and creates the Tag appropriate type ( can get type by calling
getType() method )
|
void |
startElement(java.lang.String nsURI,
java.lang.String lName,
java.lang.String qName,
org.xml.sax.Attributes attributes) |
private Tag.TType type
private static final java.lang.String version
private java.lang.StringBuffer data
protected java.util.HashMap<java.lang.String,java.lang.String> attr
protected abstract Tag parseTag() throws org.xml.sax.SAXException
org.xml.sax.SAXException - if illegal attribute formatingprotected abstract void endOfXMLDocument()
public void startElement(java.lang.String nsURI,
java.lang.String lName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionprotected java.awt.image.BufferedImage parseHexImage(java.lang.String imStr)
throws java.io.IOException,
org.xml.sax.SAXException
imStr - string representation of the image in hex formatjava.io.IOExceptionorg.xml.sax.SAXException - if length is not evenpublic java.awt.Color convertToColor(java.lang.String strC)
strC - hex representation of the colorprivate java.lang.String getFromXMLStr(java.lang.String inStr)
inStr - String that will be preparedpublic void characters(char[] arg0,
int arg1,
int arg2)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionprotected Tag.TType getType()
protected java.lang.String getData()
public java.lang.String getVersion()
public void endDocument()
throws org.xml.sax.SAXException
endDocument in interface org.xml.sax.ContentHandlerendDocument in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException