org.exolab.castor.util
Class DTDResolver

java.lang.Object
  extended by org.exolab.castor.util.DTDResolver
All Implemented Interfaces:
org.xml.sax.EntityResolver

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

Entity resolver for various DTD/schema. Holds information and performs resolving on a variety of DTD and schema, both those defined by Castor and those used by Castor and cached by it.

The following DTD and XML schema are supported:

Thie resolver can resolve both public and system identifiers, and will return an input stream into a cached resource in the Castor JAR.

This resolver can be used as wrapper to another entity resolver. For example, if a resolver is used for external entities in the mapping file, construct a new resolver using the DTDResolver(EntityResolver) constructor.

Version:
$Revision: 1.5 $ $Date: 2005/10/20 10:36:09 $
Author:
Assaf Arkin

Nested Class Summary
(package private) static class DTDResolver.DTDInfo
          Holds information about a given DTD of XML Schema.
 
Constructor Summary
DTDResolver()
          Constructs a new DTD resolver.
DTDResolver(org.xml.sax.EntityResolver resolver)
          Constructs a new DTD resolver.
 
Method Summary
 java.net.URL getBaseURL()
          Returns the base URL in use.
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          Resolves public&szstem ids to files stored within the JAR.
 void setBaseURL(java.net.URL baseUrl)
          Sets the base URL to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTDResolver

public DTDResolver(org.xml.sax.EntityResolver resolver)
Constructs a new DTD resolver. This resolver wraps another resolver and will delegate all resolving not related to the Castor mapping files to that resolver. The wrapper resolver will typically be used for entities appearing in the actual mapping file.


DTDResolver

public DTDResolver()
Constructs a new DTD resolver.

Method Detail

setBaseURL

public void setBaseURL(java.net.URL baseUrl)
Sets the base URL to use.

Parameters:
baseUrl - Base URL.

getBaseURL

public java.net.URL getBaseURL()
Returns the base URL in use.

Returns:
The base URL.

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws java.io.IOException,
                                             org.xml.sax.SAXException
Resolves public&szstem ids to files stored within the JAR.

Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Throws:
java.io.IOException
org.xml.sax.SAXException
See Also:
EntityResolver.resolveEntity(java.lang.String, java.lang.String)


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com