public class CatalogManager
extends java.lang.Object
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 |
| 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 |
|
| 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. |
Catalog| Modifier and Type | Field and Description |
|---|---|
private 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.
|
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 and Description |
|---|
CatalogManager()
Constructor.
|
CatalogManager(java.lang.String propertyFile)
Constructor that specifies an explicit property file.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
BootstrapResolver |
getBootstrapResolver() |
Catalog |
getCatalog() |
java.lang.String |
getCatalogClassName() |
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() |
boolean |
getRelativeCatalogs()
Get the relativeCatalogs setting.
|
static CatalogManager |
getStaticManager()
Allow access to the static CatalogManager
|
boolean |
getUseStaticCatalog() |
int |
getVerbosity() |
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(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.
|
private static java.lang.String pFiles
private static java.lang.String pVerbosity
private static java.lang.String pPrefer
private static java.lang.String pStatic
private static java.lang.String pAllowPI
private static java.lang.String pClassname
private static java.lang.String pIgnoreMissing
private static CatalogManager staticManager
private BootstrapResolver bResolver
private boolean ignoreMissingProperties
private java.util.ResourceBundle resources
private java.lang.String propertyFile
private java.net.URL propertyFileURI
private java.lang.String defaultCatalogFiles
private java.lang.String catalogFiles
private boolean fromPropertiesFile
private int defaultVerbosity
private java.lang.Integer verbosity
private boolean defaultPreferPublic
private java.lang.Boolean preferPublic
private boolean defaultUseStaticCatalog
private java.lang.Boolean useStaticCatalog
private static Catalog staticCatalog
private boolean defaultOasisXMLCatalogPI
private java.lang.Boolean oasisXMLCatalogPI
private boolean defaultRelativeCatalogs
private java.lang.Boolean relativeCatalogs
private java.lang.String catalogClassName
public Debug debug
This field is public so that objects that have access to this CatalogManager can use this debug object.
public CatalogManager()
public CatalogManager(java.lang.String propertyFile)
propertyFile - public void setBootstrapResolver(BootstrapResolver resolver)
resolver - public BootstrapResolver getBootstrapResolver()
private void readProperties()
public static CatalogManager getStaticManager()
public boolean getIgnoreMissingProperties()
If true, missing or unreadable property files will not be reported. Otherwise, a message will be sent to System.err.
public void setIgnoreMissingProperties(boolean ignore)
If ignore is true, missing or unreadable property files will not be reported. Otherwise, a message will be sent to System.err.
ignore - public void ignoreMissingProperties(boolean ignore)
If ignore is true, missing or unreadable property files will not be reported. Otherwise, a message will be sent to System.err.
ignore - private int queryVerbosity()
public int getVerbosity()
public void setVerbosity(int verbosity)
verbosity - public int verbosity()
private boolean queryRelativeCatalogs()
public boolean getRelativeCatalogs()
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
In the properties, a value of 'yes', 'true', or '1' is considered true, anything else is false.
public void setRelativeCatalogs(boolean relative)
relative - getRelativeCatalogs()public boolean relativeCatalogs()
private java.lang.String queryCatalogFiles()
public java.util.Vector getCatalogFiles()
public void setCatalogFiles(java.lang.String fileList)
fileList - public java.util.Vector catalogFiles()
private boolean queryPreferPublic()
In the properties, a value of 'public' is true, anything else is false.
public boolean getPreferPublic()
public void setPreferPublic(boolean preferPublic)
preferPublic - public boolean preferPublic()
private boolean queryUseStaticCatalog()
In the properties, a value of 'yes', 'true', or '1' is considered true, anything else is false.
public boolean getUseStaticCatalog()
public void setUseStaticCatalog(boolean useStatic)
useStatic - public boolean staticCatalog()
public Catalog getPrivateCatalog()
public Catalog getCatalog()
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.
public boolean getAllowOasisXMLCatalogPI()
public void setAllowOasisXMLCatalogPI(boolean allowPI)
allowPI - public boolean allowOasisXMLCatalogPI()
public java.lang.String queryCatalogClassName()
public java.lang.String getCatalogClassName()
public void setCatalogClassName(java.lang.String className)
className - public java.lang.String catalogClassName()