Luky Library - 4.1.1 (20061117-1148)

luky.xml
Class SaxMapper

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by luky.xml.SaxMapper
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public abstract class SaxMapper
extends DefaultHandler

SaxMapper is a simple mapper for XML objects. You can extend it to app the mapper classes for your XML files

Version:
1.0.0
Author:
Chris Lukassen
 

Constructor Summary
SaxMapper()
          default constructor
 
Method Summary
 void characters(char[] ch, int start, int length)
          accumulate the contents into a buffer.
abstract  TagTracker createTagTrackerNetwork()
           
 void endElement(String namespaceURI, String localName, String qName)
          Implement the content hander methods that will delegate SAX events to the tag tracker network.
 Object fromXML(InputStream in)
          creates an mapper from an input stream
 Object fromXML(Reader in)
          creates an mapper from a reader
 Object fromXML(String url)
          creates an mapper from an url
abstract  Object getMappedObject()
           
 void startElement(String namespaceURI, String localName, String qName, Attributes attr)
          Implement the content hander methods that will delegate SAX events to the tag tracker network.
 
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
 

Constructor Detail

SaxMapper

public SaxMapper()
default constructor

Method Detail

getMappedObject

public abstract Object getMappedObject()

createTagTrackerNetwork

public abstract TagTracker createTagTrackerNetwork()

fromXML

public Object fromXML(String url)
creates an mapper from an url

Parameters:
url - location of XML file

fromXML

public Object fromXML(InputStream in)
creates an mapper from an input stream

Parameters:
in - location of XML file

fromXML

public Object fromXML(Reader in)
creates an mapper from a reader

Parameters:
in - location of XML file

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes attr)
                  throws SAXException
Implement the content hander methods that will delegate SAX events to the tag tracker network.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Throws:
SAXException

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
                throws SAXException
Implement the content hander methods that will delegate SAX events to the tag tracker network.

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
accumulate the contents into a buffer.

Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Throws:
SAXException

Luky Library - 4.1.1 (20061117-1148)