com.mxgraph.reader

## Class mxSaxOutputHandler

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - com.mxgraph.reader.mxSaxOutputHandler

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

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

  XMLReader reader = SAXParserFactory.newInstance().newSAXParser() .getXMLReader(); reader.setContentHandler(new mxSaxExportHandler( new mxGraphicsExportCanvas(g2))); reader.parse(new InputSource(new StringReader(xml)));

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static interface` | `mxSaxOutputHandler.IElementHandler`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected mxICanvas2D` | `canvas`
    `protected java.util.Map<java.lang.String,mxSaxOutputHandler.IElementHandler>` | `handlers`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `mxSaxOutputHandler(mxICanvas2D canvas)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `mxICanvas2D` | `getCanvas()` Returns the canvas for rendering.
    `protected java.lang.String` | `getValue(org.xml.sax.Attributes atts, java.lang.String name, java.lang.String defaultValue)` Returns the given attribute value or an empty string.
    `protected void` | `initHandlers()`
    `void` | `setCanvas(mxICanvas2D value)` Sets the canvas for rendering.
    `void` | `startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)`

    - ### Methods inherited from class org.xml.sax.helpers.DefaultHandler

      `characters, endDocument, endElement, 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`

- - ### Field Detail

    - #### canvas

          protected mxICanvas2D canvas

    - #### handlers

          protected transient java.util.Map<java.lang.String,mxSaxOutputHandler.IElementHandler> handlers

  - ### Constructor Detail

    - #### mxSaxOutputHandler

          public mxSaxOutputHandler(mxICanvas2D canvas)

  - ### Method Detail

    - #### setCanvas

          public void setCanvas(mxICanvas2D value)

      Sets the canvas for rendering.

    - #### getCanvas

          public mxICanvas2D getCanvas()

      Returns the canvas for rendering.

    - #### startElement

          public void startElement(java.lang.String uri,
                          java.lang.String localName,
                          java.lang.String qName,
                          org.xml.sax.Attributes atts)
                            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`

    - #### initHandlers

          protected void initHandlers()

    - #### getValue

          protected java.lang.String getValue(org.xml.sax.Attributes atts,
                                  java.lang.String name,
                                  java.lang.String defaultValue)

      Returns the given attribute value or an empty string.

Copyright (c) 2010 Gaudenz Alder. All rights reserved.