Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.xml.resolver.tools
Class CatalogResolver  view CatalogResolver download CatalogResolver.java

java.lang.Object
  extended byorg.apache.xml.resolver.tools.CatalogResolver
All Implemented Interfaces:
org.xml.sax.EntityResolver, javax.xml.transform.URIResolver

public class CatalogResolver
extends java.lang.Object
implements org.xml.sax.EntityResolver, javax.xml.transform.URIResolver

A SAX EntityResolver/JAXP URIResolver that uses catalogs.

This class implements both a SAX EntityResolver and a JAXP URIResolver.

This resolver understands OASIS TR9401 catalogs, XCatalogs, and the current working draft of the OASIS Entity Resolution Technical Committee specification.

Version:
1.0

Field Summary
private  org.apache.xml.resolver.Catalog catalog
          The underlying catalog
private  org.apache.xml.resolver.CatalogManager catalogManager
          The catalog manager
 boolean namespaceAware
          Make the parser Namespace aware?
 boolean validating
          Make the parser validating?
 
Constructor Summary
CatalogResolver()
          Constructor
CatalogResolver(boolean privateCatalog)
          Constructor
CatalogResolver(org.apache.xml.resolver.CatalogManager manager)
          Constructor
 
Method Summary
 org.apache.xml.resolver.Catalog getCatalog()
          Return the underlying catalog
 java.lang.String getResolvedEntity(java.lang.String publicId, java.lang.String systemId)
          Implements the guts of the resolveEntity method for the SAX interface.
private  void initializeCatalogs(boolean privateCatalog)
          Initialize catalog
private  java.lang.String makeAbsolute(java.lang.String uri)
          Attempt to construct an absolute URI
 javax.xml.transform.Source resolve(java.lang.String href, java.lang.String base)
          JAXP URIResolver API
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          Implements the resolveEntity method for the SAX interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespaceAware

public boolean namespaceAware
Make the parser Namespace aware?


validating

public boolean validating
Make the parser validating?


catalog

private org.apache.xml.resolver.Catalog catalog
The underlying catalog


catalogManager

private org.apache.xml.resolver.CatalogManager catalogManager
The catalog manager

Constructor Detail

CatalogResolver

public CatalogResolver()
Constructor


CatalogResolver

public CatalogResolver(boolean privateCatalog)
Constructor


CatalogResolver

public CatalogResolver(org.apache.xml.resolver.CatalogManager manager)
Constructor

Method Detail

initializeCatalogs

private void initializeCatalogs(boolean privateCatalog)
Initialize catalog


getCatalog

public org.apache.xml.resolver.Catalog getCatalog()
Return the underlying catalog


getResolvedEntity

public java.lang.String getResolvedEntity(java.lang.String publicId,
                                          java.lang.String systemId)
Implements the guts of the resolveEntity method for the SAX interface.

Presented with an optional public identifier and a system identifier, this function attempts to locate a mapping in the catalogs.

If such a mapping is found, it is returned. If no mapping is found, null is returned.


resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
Implements the resolveEntity method for the SAX interface.

Presented with an optional public identifier and a system identifier, this function attempts to locate a mapping in the catalogs.

If such a mapping is found, the resolver attempts to open the mapped value as an InputSource and return it. Exceptions are ignored and null is returned if the mapped value cannot be opened as an input source.

If no mapping is found (or an error occurs attempting to open the mapped value as an input source), null is returned and the system will use the specified system identifier as if no entityResolver was specified.

Specified by:
resolveEntity in interface org.xml.sax.EntityResolver

resolve

public javax.xml.transform.Source resolve(java.lang.String href,
                                          java.lang.String base)
                                   throws javax.xml.transform.TransformerException
JAXP URIResolver API

Specified by:
resolve in interface javax.xml.transform.URIResolver

makeAbsolute

private java.lang.String makeAbsolute(java.lang.String uri)
Attempt to construct an absolute URI