TinyLine
v2.0

com.tinyline.svg
Class SVGParser

java.lang.Object
  extended bycom.tinyline.svg.SVGParser
All Implemented Interfaces:
XMLHandler

public class SVGParser
extends java.lang.Object
implements XMLHandler

The SVGParser class implements XMLHandler callbacks API for parsing the SVGT input stream.

Version:
1.9

Author:
Andrew Girow

Constructor Summary
SVGParser(SVGAttr attrParser)
          Constructs a new SVGParser object.
 
Method Summary
 void attributeName(char[] buf, int offset, int len)
          Called by XMLParser when the current lexical unit is an XML start element.
 void attributeValue(char[] buf, int offset, int len)
          Called by XMLParser when the current lexical unit is an XML attribute value.
 void charData(char[] buf, int offset, int len)
          Called by XMLParser when the current lexical unit is an XML char data.
static XMLParser createXMLParser()
          Creates a new XMLParser instance.
 void endDocument()
          Called by XMLParser when the current lexical unit is an XML document end element.
 void endElement()
          Called by XMLParser when the current lexical unit is an XML end element.
 int load(SVGDocument doc, java.io.InputStream is)
          Parses the SVGT input stream into the given SVGT document.
 void startDocument()
          Called by XMLParser when the current lexical unit is an XML document start element.
 void startElement(char[] buf, int offset, int len)
          Receive notification of the beginning of an element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVGParser

public SVGParser(SVGAttr attrParser)
Constructs a new SVGParser object.

Parameters:
attrParser - The SVGT attributes parser.
Method Detail

createXMLParser

public static XMLParser createXMLParser()
Creates a new XMLParser instance.


load

public final int load(SVGDocument doc,
                      java.io.InputStream is)
Parses the SVGT input stream into the given SVGT document.

Parameters:
doc - The empty SVGT document.
is - The SVGT input stream.
Returns:
the error code.

startDocument

public void startDocument()
Called by XMLParser when the current lexical unit is an XML document start element.

Specified by:
startDocument in interface XMLHandler

endDocument

public void endDocument()
Called by XMLParser when the current lexical unit is an XML document end element.

Specified by:
endDocument in interface XMLHandler

startElement

public void startElement(char[] buf,
                         int offset,
                         int len)
Receive notification of the beginning of an element.

Specified by:
startElement in interface XMLHandler
Parameters:
buf - The input buffer.
offset - The input buffer pointer.
len - The input buffer length.

endElement

public void endElement()
Called by XMLParser when the current lexical unit is an XML end element.

Specified by:
endElement in interface XMLHandler

attributeName

public void attributeName(char[] buf,
                          int offset,
                          int len)
Called by XMLParser when the current lexical unit is an XML start element.

Specified by:
attributeName in interface XMLHandler
Parameters:
buf - the input buffer.
offset - the initial offset.
len - the length.

attributeValue

public void attributeValue(char[] buf,
                           int offset,
                           int len)
Called by XMLParser when the current lexical unit is an XML attribute value.

Specified by:
attributeValue in interface XMLHandler
Parameters:
buf - the input buffer.
offset - the initial offset.
len - the length.

charData

public void charData(char[] buf,
                     int offset,
                     int len)
Called by XMLParser when the current lexical unit is an XML char data.

Specified by:
charData in interface XMLHandler
Parameters:
buf - the input buffer.
offset - the initial offset.
len - the length.

TinyLine
v2.0

Provided under the terms of the TinyLine License Agreement that has been included with this distribution