mxGraph 2.2.0.1


com.mxgraph.reader
Class mxSaxOutputHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.mxgraph.reader.mxSaxOutputHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class mxSaxOutputHandler
extends DefaultHandler

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


Nested Class Summary
protected static interface mxSaxOutputHandler.IElementHandler
           
 
Field Summary
protected  mxICanvas2D canvas
           
protected  Map<String,mxSaxOutputHandler.IElementHandler> handlers
           
 
Constructor Summary
mxSaxOutputHandler(mxICanvas2D canvas)
           
 
Method Summary
 mxICanvas2D getCanvas()
          Returns the canvas for rendering.
protected  String getValue(Attributes atts, String name, 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(String uri, String localName, String qName, 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 Map<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(String uri,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Throws:
SAXException

initHandlers

protected void initHandlers()

getValue

protected String getValue(Attributes atts,
                          String name,
                          String defaultValue)
Returns the given attribute value or an empty string.


mxGraph 2.2.0.1


Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.