org.apache.batik.dom.svg
Class SAXSVGDocumentFactory

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.batik.dom.util.SAXDocumentFactory
          extended by org.apache.batik.dom.svg.SAXSVGDocumentFactory
All Implemented Interfaces:
SVGDocumentFactory, DocumentFactory, ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler

public class SAXSVGDocumentFactory
extends SAXDocumentFactory
implements SVGDocumentFactory

This class contains methods for creating SVGDocument instances from an URI using SAX2.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.batik.dom.util.SAXDocumentFactory
SAXDocumentFactory.PreInfo
 
Field Summary
protected static String dtdids
          The accepted DTD public IDs.
protected static String DTDIDS
          The dtd public IDs resource bundle class name.
protected static Properties dtdProps
          The ResourceBunder for the public and system ids
protected static String HTTP_CHARSET
          Constant for HTTP content type header charset field.
static String KEY_PUBLIC_IDS
          Key used for public identifiers
static String KEY_SKIP_DTD
          Key used for the skippable DTD substitution
static String KEY_SKIPPABLE_PUBLIC_IDS
          Key used for public identifiers
static String KEY_SYSTEM_ID
          Key used for system identifiers
static Object LOCK
           
protected static String skip_dtd
          The DTD content to use when skipping
protected static String skippable_dtdids
          The DTD public IDs we know we can skip.
 
Fields inherited from class org.apache.batik.dom.util.SAXDocumentFactory
createDocumentDescriptor, currentNode, document, documentDescriptor, errorHandler, implementation, inCDATA, inDTD, inProlog, isStandalone, isValidating, locator, namespaces, parser, parserClassName, preInfo, stringBuffer, stringContent, xmlVersion
 
Constructor Summary
SAXSVGDocumentFactory(String parser)
          Creates a new SVGDocumentFactory object.
SAXSVGDocumentFactory(String parser, boolean dd)
          Creates a new SVGDocumentFactory object.
 
Method Summary
 Document createDocument(String uri)
          Creates a SVG Document instance.
 Document createDocument(String uri, InputStream inp)
          Creates a SVG Document instance.
 Document createDocument(String uri, Reader r)
          Creates a SVG Document instance.
 Document createDocument(String ns, String root, String uri)
          Creates a Document instance.
 Document createDocument(String ns, String root, String uri, InputStream is)
          Creates a Document instance.
 Document createDocument(String ns, String root, String uri, Reader r)
          Creates a Document instance.
 org.w3c.dom.svg.SVGDocument createSVGDocument(String uri)
          Creates a SVG Document instance.
 org.w3c.dom.svg.SVGDocument createSVGDocument(String uri, InputStream inp)
          Creates a SVG Document instance.
 org.w3c.dom.svg.SVGDocument createSVGDocument(String uri, Reader r)
          Creates a SVG Document instance.
 DOMImplementation getDOMImplementation(String ver)
           
 InputSource resolveEntity(String publicId, String systemId)
          SAX2: Implements EntityResolver.resolveEntity(String,String).
 void startDocument()
          SAX: Implements ContentHandler.startDocument().
 
Methods inherited from class org.apache.batik.dom.util.SAXDocumentFactory
appendStringData, characters, comment, createDocument, createDocument, createDocument, endCDATA, endDTD, endElement, endEntity, error, fatalError, getDocumentDescriptor, ignorableWhitespace, isValidating, processingInstruction, setDocumentLocator, setErrorHandler, setValidating, startCDATA, startDTD, startElement, startEntity, warning
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, notationDecl, skippedEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.batik.dom.util.DocumentFactory
createDocument, getDocumentDescriptor, isValidating, setValidating
 

Field Detail

LOCK

public static final Object LOCK

KEY_PUBLIC_IDS

public static final String KEY_PUBLIC_IDS
Key used for public identifiers

See Also:
Constant Field Values

KEY_SKIPPABLE_PUBLIC_IDS

public static final String KEY_SKIPPABLE_PUBLIC_IDS
Key used for public identifiers

See Also:
Constant Field Values

KEY_SKIP_DTD

public static final String KEY_SKIP_DTD
Key used for the skippable DTD substitution

See Also:
Constant Field Values

KEY_SYSTEM_ID

public static final String KEY_SYSTEM_ID
Key used for system identifiers

See Also:
Constant Field Values

DTDIDS

protected static final String DTDIDS
The dtd public IDs resource bundle class name.

See Also:
Constant Field Values

HTTP_CHARSET

protected static final String HTTP_CHARSET
Constant for HTTP content type header charset field.

See Also:
Constant Field Values

dtdids

protected static String dtdids
The accepted DTD public IDs.


skippable_dtdids

protected static String skippable_dtdids
The DTD public IDs we know we can skip.


skip_dtd

protected static String skip_dtd
The DTD content to use when skipping


dtdProps

protected static Properties dtdProps
The ResourceBunder for the public and system ids

Constructor Detail

SAXSVGDocumentFactory

public SAXSVGDocumentFactory(String parser)
Creates a new SVGDocumentFactory object.

Parameters:
parser - The SAX2 parser classname.

SAXSVGDocumentFactory

public SAXSVGDocumentFactory(String parser,
                             boolean dd)
Creates a new SVGDocumentFactory object.

Parameters:
parser - The SAX2 parser classname.
dd - Whether a document descriptor must be generated.
Method Detail

createSVGDocument

public org.w3c.dom.svg.SVGDocument createSVGDocument(String uri)
                                              throws IOException
Description copied from interface: SVGDocumentFactory
Creates a SVG Document instance.

Specified by:
createSVGDocument in interface SVGDocumentFactory
Parameters:
uri - The document URI.
Throws:
IOException - if an error occured while reading the document.

createSVGDocument

public org.w3c.dom.svg.SVGDocument createSVGDocument(String uri,
                                                     InputStream inp)
                                              throws IOException
Creates a SVG Document instance.

Specified by:
createSVGDocument in interface SVGDocumentFactory
Parameters:
uri - The document URI.
inp - The document input stream.
Throws:
IOException - if an error occured while reading the document.

createSVGDocument

public org.w3c.dom.svg.SVGDocument createSVGDocument(String uri,
                                                     Reader r)
                                              throws IOException
Creates a SVG Document instance.

Specified by:
createSVGDocument in interface SVGDocumentFactory
Parameters:
uri - The document URI.
r - The document reader.
Throws:
IOException - if an error occured while reading the document.

createDocument

public Document createDocument(String uri)
                        throws IOException
Creates a SVG Document instance. This method supports gzipped sources.

Overrides:
createDocument in class SAXDocumentFactory
Parameters:
uri - The document URI.
Throws:
IOException - if an error occured while reading the document.

createDocument

public Document createDocument(String uri,
                               InputStream inp)
                        throws IOException
Creates a SVG Document instance.

Overrides:
createDocument in class SAXDocumentFactory
Parameters:
uri - The document URI.
inp - The document input stream.
Throws:
IOException - if an error occured while reading the document.

createDocument

public Document createDocument(String uri,
                               Reader r)
                        throws IOException
Creates a SVG Document instance.

Overrides:
createDocument in class SAXDocumentFactory
Parameters:
uri - The document URI.
r - The document reader.
Throws:
IOException - if an error occured while reading the document.

createDocument

public Document createDocument(String ns,
                               String root,
                               String uri)
                        throws IOException
Creates a Document instance.

Specified by:
createDocument in interface DocumentFactory
Overrides:
createDocument in class SAXDocumentFactory
Parameters:
ns - The namespace URI of the root element of the document.
root - The name of the root element of the document.
uri - The document URI.
Throws:
IOException - if an error occured while reading the document.

createDocument

public Document createDocument(String ns,
                               String root,
                               String uri,
                               InputStream is)
                        throws IOException
Creates a Document instance.

Specified by:
createDocument in interface DocumentFactory
Overrides:
createDocument in class SAXDocumentFactory
Parameters:
ns - The namespace URI of the root element of the document.
root - The name of the root element of the document.
uri - The document URI.
is - The document input stream.
Throws:
IOException - if an error occured while reading the document.

createDocument

public Document createDocument(String ns,
                               String root,
                               String uri,
                               Reader r)
                        throws IOException
Creates a Document instance.

Specified by:
createDocument in interface DocumentFactory
Overrides:
createDocument in class SAXDocumentFactory
Parameters:
ns - The namespace URI of the root element of the document.
root - The name of the root element of the document.
uri - The document URI.
r - The document reader.
Throws:
IOException - if an error occured while reading the document.

getDOMImplementation

public DOMImplementation getDOMImplementation(String ver)
Overrides:
getDOMImplementation in class SAXDocumentFactory

startDocument

public void startDocument()
                   throws SAXException
SAX: Implements ContentHandler.startDocument().

Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class SAXDocumentFactory
Throws:
SAXException

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException
SAX2: Implements EntityResolver.resolveEntity(String,String).

Specified by:
resolveEntity in interface EntityResolver
Overrides:
resolveEntity in class DefaultHandler
Throws:
SAXException


Copyright © 2008 Apache Software Foundation. All Rights Reserved.