thredds.catalog
Class XMLEntityResolver

java.lang.Object
  extended by thredds.catalog.XMLEntityResolver
All Implemented Interfaces:
EntityResolver

public class XMLEntityResolver
extends Object
implements EntityResolver

Handles the interaction with JAXP, resolving dtd, schemas locally if possible. Get a javax.xml.parsers.DocumentBuilder from here, allows you to validate or not.

The Crimson parser wont do schema validation.

Author:
John Caron

Field Summary
static String CATALOG_NAMESPACE_06
           
static String CATALOG_NAMESPACE_10
           
static String CATGEN_NAMESPACE_05
           
static String DQC_NAMESPACE_02
           
static String DQC_NAMESPACE_03
           
static String DQC_NAMESPACE_04
           
static String NJ22_NAMESPACE
           
static String W3C_XML_NAMESPACE
           
static String XLINK_NAMESPACE
           
static org.jdom.Namespace xlinkNS
           
static org.jdom.Namespace xsiNS
           
 
Constructor Summary
XMLEntityResolver(boolean validate)
           
 
Method Summary
static String getDocumentBuilderFactoryVersion()
           
 StringBuilder getErrorMessages()
           
static String getExternalSchemas()
           
 StringBuilder getFatalMessages()
           
 org.jdom.input.SAXBuilder getSAXBuilder()
           
 StringBuilder getWarningMessages()
           
static void initEntity(String entityName, String resourceName, String urlName)
          Add an entity for resolution.
 InputSource resolveEntity(String publicId, String systemId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

W3C_XML_NAMESPACE

public static final String W3C_XML_NAMESPACE
See Also:
Constant Field Values

CATALOG_NAMESPACE_06

public static final String CATALOG_NAMESPACE_06
See Also:
Constant Field Values

CATALOG_NAMESPACE_10

public static final String CATALOG_NAMESPACE_10
See Also:
Constant Field Values

DQC_NAMESPACE_02

public static final String DQC_NAMESPACE_02
See Also:
Constant Field Values

DQC_NAMESPACE_03

public static final String DQC_NAMESPACE_03
See Also:
Constant Field Values

DQC_NAMESPACE_04

public static final String DQC_NAMESPACE_04
See Also:
Constant Field Values

CATGEN_NAMESPACE_05

public static final String CATGEN_NAMESPACE_05
See Also:
Constant Field Values

NJ22_NAMESPACE

public static final String NJ22_NAMESPACE
See Also:
Constant Field Values

XLINK_NAMESPACE

public static final String XLINK_NAMESPACE
See Also:
Constant Field Values

xlinkNS

public static final org.jdom.Namespace xlinkNS

xsiNS

public static final org.jdom.Namespace xsiNS
Constructor Detail

XMLEntityResolver

public XMLEntityResolver(boolean validate)
Method Detail

getExternalSchemas

public static String getExternalSchemas()

initEntity

public static void initEntity(String entityName,
                              String resourceName,
                              String urlName)
Add an entity for resolution. Specify a local resource, and/or a URL. Look for the local Resource first.

Parameters:
entityName - name of entity, eg the namespace String
resourceName - resolve using this Resource, found on the class path
urlName - resolve using this Resource, found on the class path

getDocumentBuilderFactoryVersion

public static String getDocumentBuilderFactoryVersion()

getSAXBuilder

public org.jdom.input.SAXBuilder getSAXBuilder()

getWarningMessages

public StringBuilder getWarningMessages()

getErrorMessages

public StringBuilder getErrorMessages()

getFatalMessages

public StringBuilder getFatalMessages()

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException,
                                 IOException
Specified by:
resolveEntity in interface EntityResolver
Throws:
SAXException
IOException


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.