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:

    Config Values
    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
    Author:
    Norman Walsh Norman.Walsh@Sun.COM
    See Also:
    Catalog
    • Field Detail

      • 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 Detail

      • CatalogManager

        public CatalogManager()
        Constructor.
      • CatalogManager

        public CatalogManager​(String propertyFile)
    • Method Detail

      • setBootstrapResolver

        public void setBootstrapResolver​(BootstrapResolver resolver)
      • getIgnoreMissingProperties

        public boolean getIgnoreMissingProperties()
      • setIgnoreMissingProperties

        public void setIgnoreMissingProperties​(boolean ignore)
      • getVerbosity

        public int getVerbosity()
      • setVerbosity

        public void setVerbosity​(int verbosity)
      • 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.
      • setRelativeCatalogs

        public void setRelativeCatalogs​(boolean relative)
      • getCatalogFiles

        public List<String> 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.
      • setCatalogFiles

        public void setCatalogFiles​(String fileList)
      • getPreferPublic

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

        public void setPreferPublic​(boolean preferPublic)
      • getUseStaticCatalog

        public boolean getUseStaticCatalog()
      • setUseStaticCatalog

        public void setUseStaticCatalog​(boolean useStatic)
      • getCatalog

        public final Catalog getCatalog()
      • 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.
      • getAllowOasisXMLCatalogPI

        public boolean getAllowOasisXMLCatalogPI()
      • setAllowOasisXMLCatalogPI

        public void setAllowOasisXMLCatalogPI​(boolean allowPI)
      • queryCatalogClassName

        public String queryCatalogClassName()
      • getCatalogClassName

        public String getCatalogClassName()
      • setCatalogClassName

        public void setCatalogClassName​(String className)