org.apache.xml.resolver

Class CatalogManager


public class CatalogManager
extends 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 PropertyCatalogManager.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.filescatalogsThe semicolon-delimited list of catalog files.
 relative-catalogsIf 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.verbosityverbosityIf non-zero, the Catalog classes will print informative and debugging messages. The higher the number, the more messages.
xml.catalog.preferpreferWhich identifier is preferred, "public" or "system"?
xml.catalog.staticCatalogstatic-catalogShould a single catalog be constructed for all parsing, or should a different catalog be created for each parser?
xml.catalog.allowPIallow-oasis-xml-catalog-piIf the source document contains "oasis-xml-catalog" processing instructions, should they be used?
xml.catalog.classNamecatalog-class-nameIf 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
Author:
Norman Walsh Norman.Walsh@Sun.COM
See Also:
Catalog

Field Summary

Debug
debug
The manager's debug object.

Constructor Summary

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

Method Summary

boolean
allowOasisXMLCatalogPI()
Deprecated. No longer static; use get/set methods.
String
catalogClassName()
Deprecated. No longer static; use get/set methods.
Vector
catalogFiles()
Deprecated. No longer static; use get/set methods.
boolean
getAllowOasisXMLCatalogPI()
Get the current XML Catalog PI setting.
BootstrapResolver
getBootstrapResolver()
Get the bootstrap resolver.
Catalog
getCatalog()
Get a catalog instance.
String
getCatalogClassName()
Get the current Catalog class name.
Vector
getCatalogFiles()
Return the current list of catalog files.
boolean
getIgnoreMissingProperties()
How are missing properties handled?

If true, missing or unreadable property files will not be reported.

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.
String
queryCatalogClassName()
Obtain the Catalog class name setting from the properties.
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(String className)
Set the Catalog class name.
void
setCatalogFiles(String fileList)
Set the list of catalog files.
void
setIgnoreMissingProperties(boolean ignore)
How should missing properties be handled?

If ignore is true, missing or unreadable property files will not be reported.

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.

Field Details

debug

public 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 Details

CatalogManager

public CatalogManager()
Constructor.

CatalogManager

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

Method Details

allowOasisXMLCatalogPI

public boolean allowOasisXMLCatalogPI()

Deprecated. No longer static; use get/set methods.

Get the current XML Catalog PI setting.

catalogClassName

public String catalogClassName()

Deprecated. No longer static; use get/set methods.

Get the current Catalog class name.

catalogFiles

public Vector catalogFiles()

Deprecated. No longer static; use get/set methods.

Return the current list of catalog files.
Returns:
A vector of the catalog file names or null if no catalogs are available in the properties.

getAllowOasisXMLCatalogPI

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

getBootstrapResolver

public BootstrapResolver getBootstrapResolver()
Get the bootstrap resolver.

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.

getCatalogClassName

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

getCatalogFiles

public Vector getCatalogFiles()
Return the current list of catalog files.
Returns:
A vector of the catalog file names or null if no catalogs are available in the properties.

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.


getPreferPublic

public boolean getPreferPublic()
Return the current prefer public setting.
Returns:
True if public identifiers are preferred.

getPrivateCatalog

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

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.

Returns:
The relativeCatalogs setting from the propertyFile or the defaultRelativeCatalogs.

getStaticManager

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

getUseStaticCatalog

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

getVerbosity

public int getVerbosity()
What is the current verbosity?

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.


preferPublic

public boolean preferPublic()

Deprecated. No longer static; use get/set methods.

Return the current prefer public setting.
Returns:
True if public identifiers are preferred.

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.

Returns:
The oasisXMLCatalogPI setting from the propertyFile or the defaultOasisXMLCatalogPI.

queryCatalogClassName

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

relativeCatalogs

public boolean relativeCatalogs()

Deprecated. No longer static; use get/set methods.

Get the relativeCatalogs setting.

setAllowOasisXMLCatalogPI

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

setBootstrapResolver

public void setBootstrapResolver(BootstrapResolver resolver)
Set the bootstrap resolver.

setCatalogClassName

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

setCatalogFiles

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

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.


setPreferPublic

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

setRelativeCatalogs

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

setUseStaticCatalog

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

setVerbosity

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

staticCatalog

public boolean staticCatalog()

Deprecated. No longer static; use get/set methods.

Get the current use static catalog setting.

verbosity

public int verbosity()

Deprecated. No longer static; use get/set methods.

What is the current verbosity?

Copyright B) 2001-2003 Apache Software Foundation. All Rights Reserved.