Class XMLResolverConfiguration

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCatalog​(java.lang.String catalog)
      Add a catalog file to the list of catalogs.
      void addCatalog​(java.net.URI catalog, org.xml.sax.InputSource data)
      Add a catalog file to the list of catalogs.
      <T> T getFeature​(ResolverFeature<T> feature)
      Return the value of a feature.
      java.util.Iterator<ResolverFeature<?>> getFeatures()
      Iterate over all the known features.
      boolean removeCatalog​(java.lang.String catalog)
      Remove a catalog from the list of catalogs.
      <T> void setFeature​(ResolverFeature<T> feature, T value)
      Set a configuration feature.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XMLResolverConfiguration

        public XMLResolverConfiguration()
        Construct a default configuration.

        The default configuration uses system properties and searches the classpath for an xmlcatalog.properties file. It uses the settings found there to configure the resolver.

      • XMLResolverConfiguration

        public XMLResolverConfiguration​(java.lang.String catalogFiles)
        Construct a configuration from a delimited string of catalog files.

        The default configuration uses system properties and searches the classpath for an xmlcatalog.properties file. It uses the settings found there to configure the resolver, but replaces any list of catalog files found there with the catalog files provided in the constructor.

        Parameters:
        catalogFiles - A semi-colon (;) delimited list of catalog files
      • XMLResolverConfiguration

        public XMLResolverConfiguration​(java.util.List<java.lang.String> catalogFiles)
        Construct a configuration from a list of catalog files.

        The default configuration uses system properties and searches the classpath for an xmlcatalog.properties file. It uses the settings found there to configure the resolver, but replaces any list of catalog files found there with the catalog files provided in the constructor.

        Parameters:
        catalogFiles - A list of catalog files.
      • XMLResolverConfiguration

        public XMLResolverConfiguration​(java.util.List<java.net.URL> propertyFiles,
                                        java.util.List<java.lang.String> catalogFiles)
        Construct a resolver configuration with specific properties and catalog files.

        The default configuration uses system properties and the properties found in the first propertyFiles property file that it can read. (It uses at most one property file.) It uses those settings to configure the resolver, but replaces any list of catalog files found there with the catalog files provided in the constructor.

        Parameters:
        propertyFiles - A list of property files from which to attempt to load configuration properties.
        catalogFiles - A list of catalog files.
      • XMLResolverConfiguration

        public XMLResolverConfiguration​(XMLResolverConfiguration current)
        A copying constructor.

        This constructor creates a new resolver configuration with the same properties as an existing configuration. It gets its own copy of the catalog file list and CatalogManager.

        Parameters:
        current - The configuration to copy.
    • Method Detail

      • addCatalog

        public void addCatalog​(java.lang.String catalog)
        Add a catalog file to the list of catalogs.

        This adds a catalog file to the end of the list of catalogs. This file will be loaded by opening the specified file.

        Parameters:
        catalog - The catalog file.
      • addCatalog

        public void addCatalog​(java.net.URI catalog,
                               org.xml.sax.InputSource data)
        Add a catalog file to the list of catalogs.

        This adds a catalog file to the end of the list of catalogs. This file will be loaded by reading from the specified input source.

        Parameters:
        catalog - The catalog file.
        data - The input source that provides the catalog content.
        Throws:
        java.lang.NullPointerException - if either catalog or data is null.
      • removeCatalog

        public boolean removeCatalog​(java.lang.String catalog)
        Remove a catalog from the list of catalogs.

        Removes the specified catalog from the list of catalogs (if it was present in the list).

        Parameters:
        catalog - The catalog file.
        Returns:
        True if the catalog was removed.
      • setFeature

        public <T> void setFeature​(ResolverFeature<T> feature,
                                   T value)
        Set a configuration feature.

        Sets the specified feature to the specified value. Unknown features are ignored.

        Specified by:
        setFeature in interface ResolverConfiguration
        Type Parameters:
        T - A type appropriate for the feature.
        Parameters:
        feature - The feature.
        value - The new value.
        Throws:
        java.lang.NullPointerException - if the value is null for features that cannot be null
      • getFeature

        public <T> T getFeature​(ResolverFeature<T> feature)
        Return the value of a feature.

        Returns the value of the specified feature.

        Specified by:
        getFeature in interface ResolverConfiguration
        Type Parameters:
        T - A type appropriate to the feature.
        Parameters:
        feature - The feature or null if the feature is unknown.
        Returns:
        The feature value.