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

Quick Search    Search Deep

org.apache.xml.resolver
Class CatalogManager  view CatalogManager download CatalogManager.java

java.lang.Object
  extended byorg.apache.xml.resolver.CatalogManager

public class CatalogManager
extends java.lang.Object

CatalogManager provides an interface to the catalog properties.

Properties can come from two places: from system properties or from a CatalogManager.properties file. This class provides a transparent interface to both, with system properties preferred over property file values.

The following table summarizes the properties:

System Property CatalogManager.properties
Property
Description
xml.catalog.ignoreMissing   If true, a missing CatalogManager.properties file or missing properties within that file will not generate warning messages. See also the ignoreMissingProperties method.
xml.catalog.files catalogs The semicolon-delimited list of catalog files.
  relative-catalogs If false, relative catalog URIs are made absolute with respect to the base URI of the CatalogManager.properties file. This setting only applies to catalog URIs obtained from the catalogs property in the CatalogManager.properties file
xml.catalog.verbosity verbosity If non-zero, the Catalog classes will print informative and debugging messages. The higher the number, the more messages.
xml.catalog.prefer prefer Which identifier is preferred, "public" or "system"?
xml.catalog.staticCatalog static-catalog Should a single catalog be constructed for all parsing, or should a different catalog be created for each parser?
xml.catalog.allowPI allow-oasis-xml-catalog-pi If the source document contains "oasis-xml-catalog" processing instructions, should they be used?
xml.catalog.className catalog-class-name If you're using the convenience classes org.apache.xml.resolver.tools.*), this setting allows you to specify an alternate class name to use for the underlying catalog.

Version:
1.0

Field Summary
private  org.apache.xml.resolver.helpers.BootstrapResolver bResolver
          The bootstrap resolver to use when loading XML Catalogs.
private  java.lang.String catalogClassName
          Current catalog class name.
private  java.lang.String catalogFiles
          Current catalog files list.
 org.apache.xml.resolver.helpers.Debug debug
          The manager's debug object.
private  java.lang.String defaultCatalogFiles
          Default catalog files list.
private  boolean defaultOasisXMLCatalogPI
          Default setting of the oasisXMLCatalogPI flag.
private  boolean defaultPreferPublic
          Default preference setting.
private  boolean defaultRelativeCatalogs
          Default setting of the relativeCatalogs flag.
private  boolean defaultUseStaticCatalog
          Default setting of the static catalog flag.
private  int defaultVerbosity
          Default verbosity level if there is no property setting for it.
private  boolean fromPropertiesFile
          Did the catalgoFiles come from the properties file?
private  boolean ignoreMissingProperties
          Flag to ignore missing property files and/or properties
private  java.lang.Boolean oasisXMLCatalogPI
          Current setting of the oasisXMLCatalogPI flag.
private static java.lang.String pAllowPI
           
private static java.lang.String pClassname
           
private static java.lang.String pFiles
           
private static java.lang.String pIgnoreMissing
           
private static java.lang.String pPrefer
           
private  java.lang.Boolean preferPublic
          Current preference setting.
private  java.lang.String propertyFile
          The name of the CatalogManager properties file.
private  java.net.URL propertyFileURI
          The location of the propertyFile
private static java.lang.String pStatic
           
private static java.lang.String pVerbosity
           
private  java.lang.Boolean relativeCatalogs
          Current setting of the relativeCatalogs flag.
private  java.util.ResourceBundle resources
          Holds the resources after they are loaded from the file.
private static Catalog staticCatalog
          The static catalog used by this manager.
private static CatalogManager staticManager
          A static CatalogManager instance for sharing
private  java.lang.Boolean useStaticCatalog
          Current setting of the static catalog flag.
private  java.lang.Integer verbosity
          Current verbosity level.
 
Constructor Summary
CatalogManager()
          Constructor.
CatalogManager(java.lang.String propertyFile)
          Constructor that specifies an explicit property file.
 
Method Summary
 boolean allowOasisXMLCatalogPI()
          Deprecated. No longer static; use get/set methods.
 java.lang.String catalogClassName()
          Deprecated. No longer static; use get/set methods.
 java.util.Vector catalogFiles()
          Deprecated. No longer static; use get/set methods.
 boolean getAllowOasisXMLCatalogPI()
          Get the current XML Catalog PI setting.
 org.apache.xml.resolver.helpers.BootstrapResolver getBootstrapResolver()
          Get the bootstrap resolver.
 Catalog getCatalog()
          Get a catalog instance.
 java.lang.String getCatalogClassName()
          Get the current Catalog class name.
 java.util.Vector getCatalogFiles()
          Return the current list of catalog files.
 boolean getIgnoreMissingProperties()
          How are missing properties handled?
 boolean getPreferPublic()
          Return the current prefer public setting.
 Catalog getPrivateCatalog()
          Get a new catalog instance.
 boolean getRelativeCatalogs()
          Get the relativeCatalogs setting.
static CatalogManager getStaticManager()
          Allow access to the static CatalogManager
 boolean getUseStaticCatalog()
          Get the current use static catalog setting.
 int getVerbosity()
          What is the current verbosity?
 void ignoreMissingProperties(boolean ignore)
          Deprecated. No longer static; use get/set methods.
 boolean preferPublic()
          Deprecated. No longer static; use get/set methods.
 boolean queryAllowOasisXMLCatalogPI()
          Obtain the oasisXMLCatalogPI setting from the properties.
 java.lang.String queryCatalogClassName()
          Obtain the Catalog class name setting from the properties.
private  java.lang.String queryCatalogFiles()
          Obtain the list of catalog files from the properties.
private  boolean queryPreferPublic()
          Obtain the preferPublic setting from the properties.
private  boolean queryRelativeCatalogs()
          Obtain the relativeCatalogs setting from the properties.
private  boolean queryUseStaticCatalog()
          Obtain the static-catalog setting from the properties.
private  int queryVerbosity()
          Obtain the verbosity setting from the properties.
private  void readProperties()
          Load the properties from the propertyFile and build the resources from it.
 boolean relativeCatalogs()
          Deprecated. No longer static; use get/set methods.
 void setAllowOasisXMLCatalogPI(boolean allowPI)
          Set the XML Catalog PI setting
 void setBootstrapResolver(org.apache.xml.resolver.helpers.BootstrapResolver resolver)
          Set the bootstrap resolver.
 void setCatalogClassName(java.lang.String className)
          Set the Catalog class name.
 void setCatalogFiles(java.lang.String fileList)
          Set the list of catalog files.
 void setIgnoreMissingProperties(boolean ignore)
          How should missing properties be handled?
 void setPreferPublic(boolean preferPublic)
          Set the prefer public setting.
 void setRelativeCatalogs(boolean relative)
          Set the relativeCatalogs setting.
 void setUseStaticCatalog(boolean useStatic)
          Set the use static catalog setting.
 void setVerbosity(int verbosity)
          Set the current verbosity.
 boolean staticCatalog()
          Deprecated. No longer static; use get/set methods.
 int verbosity()
          Deprecated. No longer static; use get/set methods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pFiles

private static java.lang.String pFiles

pVerbosity

private static java.lang.String pVerbosity

pPrefer

private static java.lang.String pPrefer

pStatic

private static java.lang.String pStatic

pAllowPI

private static java.lang.String pAllowPI

pClassname

private static java.lang.String pClassname

pIgnoreMissing

private static java.lang.String pIgnoreMissing

staticManager

private static CatalogManager staticManager
A static CatalogManager instance for sharing


bResolver

private org.apache.xml.resolver.helpers.BootstrapResolver bResolver
The bootstrap resolver to use when loading XML Catalogs.


ignoreMissingProperties

private boolean ignoreMissingProperties
Flag to ignore missing property files and/or properties


resources

private java.util.ResourceBundle resources
Holds the resources after they are loaded from the file.


propertyFile

private java.lang.String propertyFile
The name of the CatalogManager properties file.


propertyFileURI

private java.net.URL propertyFileURI
The location of the propertyFile


defaultCatalogFiles

private java.lang.String defaultCatalogFiles
Default catalog files list.


catalogFiles

private java.lang.String catalogFiles
Current catalog files list.


fromPropertiesFile

private boolean fromPropertiesFile
Did the catalgoFiles come from the properties file?


defaultVerbosity

private int defaultVerbosity
Default verbosity level if there is no property setting for it.


verbosity

private java.lang.Integer verbosity
Current verbosity level.


defaultPreferPublic

private boolean defaultPreferPublic
Default preference setting.


preferPublic

private java.lang.Boolean preferPublic
Current preference setting.


defaultUseStaticCatalog

private boolean defaultUseStaticCatalog
Default setting of the static catalog flag.


useStaticCatalog

private java.lang.Boolean useStaticCatalog
Current setting of the static catalog flag.


staticCatalog

private static Catalog staticCatalog
The static catalog used by this manager.


defaultOasisXMLCatalogPI

private boolean defaultOasisXMLCatalogPI
Default setting of the oasisXMLCatalogPI flag.


oasisXMLCatalogPI

private java.lang.Boolean oasisXMLCatalogPI
Current setting of the oasisXMLCatalogPI flag.


defaultRelativeCatalogs

private boolean defaultRelativeCatalogs
Default setting of the relativeCatalogs flag.


relativeCatalogs

private java.lang.Boolean relativeCatalogs
Current setting of the relativeCatalogs flag.


catalogClassName

private java.lang.String catalogClassName
Current catalog class name.


debug

public org.apache.xml.resolver.helpers.Debug debug
The manager's debug object. Used for printing debugging messages.

This field is public so that objects that have access to this CatalogManager can use this debug object.

Constructor Detail

CatalogManager

public CatalogManager()
Constructor.


CatalogManager

public CatalogManager(java.lang.String propertyFile)
Constructor that specifies an explicit property file.

Method Detail

setBootstrapResolver

public void setBootstrapResolver(org.apache.xml.resolver.helpers.BootstrapResolver resolver)
Set the bootstrap resolver.


getBootstrapResolver

public org.apache.xml.resolver.helpers.BootstrapResolver getBootstrapResolver()
Get the bootstrap resolver.


readProperties

private void readProperties()
Load the properties from the propertyFile and build the resources from it.


getStaticManager

public static CatalogManager getStaticManager()
Allow access to the static CatalogManager


getIgnoreMissingProperties

public boolean getIgnoreMissingProperties()
How are missing properties handled?

If true, missing or unreadable property files will not be reported. Otherwise, a message will be sent to System.err.


setIgnoreMissingProperties

public void setIgnoreMissingProperties(boolean ignore)
How should missing properties be handled?

If ignore is true, missing or unreadable property files will not be reported. Otherwise, a message will be sent to System.err.


ignoreMissingProperties

public void ignoreMissingProperties(boolean ignore)
Deprecated. No longer static; use get/set methods.

How are missing properties handled?

If ignore is true, missing or unreadable property files will not be reported. Otherwise, a message will be sent to System.err.


queryVerbosity

private int queryVerbosity()
Obtain the verbosity setting from the properties.


getVerbosity

public int getVerbosity()
What is the current verbosity?


setVerbosity

public void setVerbosity(int verbosity)
Set the current verbosity.


verbosity

public int verbosity()
Deprecated. No longer static; use get/set methods.

What is the current verbosity?


queryRelativeCatalogs

private boolean queryRelativeCatalogs()
Obtain the relativeCatalogs setting from the properties.


getRelativeCatalogs

public boolean getRelativeCatalogs()
Get the relativeCatalogs setting.

This property is used when the catalogFiles property is interrogated. If true, then relative catalog entry file names are returned. If false, relative catalog entry file names are made absolute with respect to the properties file before returning them.

This property only applies when the catalog files come from a properties file. If they come from a system property or the default list, they are never considered relative. (What would they be relative to?)

In the properties, a value of 'yes', 'true', or '1' is considered true, anything else is false.


setRelativeCatalogs

public void setRelativeCatalogs(boolean relative)
Set the relativeCatalogs setting.


relativeCatalogs

public boolean relativeCatalogs()
Deprecated. No longer static; use get/set methods.

Get the relativeCatalogs setting.


queryCatalogFiles

private java.lang.String queryCatalogFiles()
Obtain the list of catalog files from the properties.


getCatalogFiles

public java.util.Vector getCatalogFiles()
Return the current list of catalog files.


setCatalogFiles

public void setCatalogFiles(java.lang.String fileList)
Set the list of catalog files.


catalogFiles

public java.util.Vector catalogFiles()
Deprecated. No longer static; use get/set methods.

Return the current list of catalog files.


queryPreferPublic

private boolean queryPreferPublic()
Obtain the preferPublic setting from the properties.

In the properties, a value of 'public' is true, anything else is false.


getPreferPublic

public boolean getPreferPublic()
Return the current prefer public setting.


setPreferPublic

public void setPreferPublic(boolean preferPublic)
Set the prefer public setting.


preferPublic

public boolean preferPublic()
Deprecated. No longer static; use get/set methods.

Return the current prefer public setting.


queryUseStaticCatalog

private boolean queryUseStaticCatalog()
Obtain the static-catalog setting from the properties.

In the properties, a value of 'yes', 'true', or '1' is considered true, anything else is false.


getUseStaticCatalog

public boolean getUseStaticCatalog()
Get the current use static catalog setting.


setUseStaticCatalog

public void setUseStaticCatalog(boolean useStatic)
Set the use static catalog setting.


staticCatalog

public boolean staticCatalog()
Deprecated. No longer static; use get/set methods.

Get the current use static catalog setting.


getPrivateCatalog

public Catalog getPrivateCatalog()
Get a new catalog instance. This method always returns a new instance of the underlying catalog class.


getCatalog

public Catalog getCatalog()
Get a catalog instance. If this manager uses static catalogs, the same static catalog will always be returned. Otherwise a new catalog will be returned.


queryAllowOasisXMLCatalogPI

public boolean queryAllowOasisXMLCatalogPI()

Obtain the oasisXMLCatalogPI setting from the properties.

In the properties, a value of 'yes', 'true', or '1' is considered true, anything else is false.


getAllowOasisXMLCatalogPI

public boolean getAllowOasisXMLCatalogPI()
Get the current XML Catalog PI setting.


setAllowOasisXMLCatalogPI

public void setAllowOasisXMLCatalogPI(boolean allowPI)
Set the XML Catalog PI setting


allowOasisXMLCatalogPI

public boolean allowOasisXMLCatalogPI()
Deprecated. No longer static; use get/set methods.

Get the current XML Catalog PI setting.


queryCatalogClassName

public java.lang.String queryCatalogClassName()
Obtain the Catalog class name setting from the properties.


getCatalogClassName

public java.lang.String getCatalogClassName()
Get the current Catalog class name.


setCatalogClassName

public void setCatalogClassName(java.lang.String className)
Set the Catalog class name.


catalogClassName

public java.lang.String catalogClassName()
Deprecated. No longer static; use get/set methods.

Get the current Catalog class name.