com.jmex.model.converters
Class DTDResolver

java.lang.Object
  extended by com.jmex.model.converters.DTDResolver
All Implemented Interfaces:
org.xml.sax.EntityResolver

public class DTDResolver
extends java.lang.Object
implements org.xml.sax.EntityResolver

An EntityResolver that can be used to provide the DTDs for XML parsing (e.g. X3D parsing) locally instead of letting the DocumentBuilder download them from their respective servers.
An EntityResolver can be passed to a DocumentBuilder via the method setEntityResolver(EntityResolver).

Version:
2008-01-27
Author:
Michael Sattler

Constructor Summary
DTDResolver(java.util.Map<java.lang.String,?> dtdInput)
          Creates a resolver using the given Map to resolve the DTD files used for X3D parsing.
 
Method Summary
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTDResolver

public DTDResolver(java.util.Map<java.lang.String,?> dtdInput)
Creates a resolver using the given Map to resolve the DTD files used for X3D parsing.
The keys in the map may either be the full System Identifiers of the DTDs (e.g. "http://www.web3d.org/specifications/x3d-3.0.dtd") or just the file names (e.g. "x3d-3.0.dtd").
The values may be either byte arrays or InputStreams. If byte arrays are used, they are used by-reference. If InputStreams are passed, they will be read and the contents will be stored.

Parameters:
dtdInput - The mapping the names of DTD files to their InputStreams
Method Detail

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException,
                                             java.io.IOException
Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Throws:
org.xml.sax.SAXException
java.io.IOException