de.vc.xml

## Class XML2ObjectTransformer

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - de.vc.xml.XML2ObjectTransformer

- All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

      public class XML2ObjectTransformer
      extends org.xml.sax.helpers.DefaultHandler

  The XMLReader gets an InputStream as source and builds an object tree. You can register varios ObjectFactories that builds special objects. If the XMLReader encouters a XML-node for that no ObjectFactory can create an object, a DefaultNode is created.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XML2ObjectTransformer()`
    `XML2ObjectTransformer(org.apache.commons.logging.Log logger)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `characters(char[] chars, int offset, int length)`
    `void` | `endElement(java.lang.String p0, java.lang.String p1, java.lang.String p2)`
    `protected void` | `flushBuffer()`
    `java.lang.Object[]` | `parse(java.io.InputStream source)`
    `void` | `register(XMLObjectFactory factory)`
    `void` | `startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attr)`

    - ### 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

    - #### XML2ObjectTransformer

          public XML2ObjectTransformer()

    - #### XML2ObjectTransformer

          public XML2ObjectTransformer(org.apache.commons.logging.Log logger)

  - ### Method Detail

    - #### parse

          public java.lang.Object[] parse(java.io.InputStream source)
                                   throws java.io.IOException,
                                          org.xml.sax.SAXException

      Throws:
        `java.io.IOException`
        `org.xml.sax.SAXException`

    - #### startElement

          public void startElement(java.lang.String namespaceURI,
                          java.lang.String localName,
                          java.lang.String qName,
                          org.xml.sax.Attributes attr)
                            throws org.xml.sax.SAXException

      Specified by:
        `startElement` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `startElement` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### characters

          public void characters(char[] chars,
                        int offset,
                        int length)
                          throws org.xml.sax.SAXException

      Specified by:
        `characters` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `characters` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### endElement

          public void endElement(java.lang.String p0,
                        java.lang.String p1,
                        java.lang.String p2)
                          throws org.xml.sax.SAXException

      Specified by:
        `endElement` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `endElement` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### register

          public void register(XMLObjectFactory factory)

    - #### flushBuffer

          protected void flushBuffer()
                              throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.