Class XMLResolverConfiguration

    • Field Detail

      • classpathCatalogList

        private static java.util.List<java.lang.String> classpathCatalogList
      • catalogs

        private final java.util.List<java.lang.String> catalogs
      • additionalCatalogs

        private final java.util.List<java.lang.String> additionalCatalogs
      • preferPublic

        private java.lang.Boolean preferPublic
      • preferPropertyFile

        private java.lang.Boolean preferPropertyFile
      • allowCatalogPI

        private java.lang.Boolean allowCatalogPI
      • alwaysResolve

        private java.lang.Boolean alwaysResolve
      • cacheDirectory

        private java.lang.String cacheDirectory
      • cacheUnderHome

        private java.lang.Boolean cacheUnderHome
      • cacheEnabled

        private java.lang.Boolean cacheEnabled
      • uriForSystem

        private java.lang.Boolean uriForSystem
      • mergeHttps

        private java.lang.Boolean mergeHttps
      • maskJarUris

        private java.lang.Boolean maskJarUris
      • catalogLoader

        private java.lang.String catalogLoader
      • parseRddl

        private java.lang.Boolean parseRddl
      • classpathCatalogs

        private java.lang.Boolean classpathCatalogs
      • classLoader

        private java.lang.ClassLoader classLoader
      • archivedCatalogs

        private java.lang.Boolean archivedCatalogs
      • throwUriExceptions

        private java.lang.Boolean throwUriExceptions
      • showConfigChanges

        private java.lang.Boolean showConfigChanges
      • resolverLoggerClass

        private java.lang.String resolverLoggerClass
      • defaultLoggerLogLevel

        private java.lang.String defaultLoggerLogLevel
      • accessExternalEntity

        private java.lang.String accessExternalEntity
      • accessExternalDocument

        private java.lang.String accessExternalDocument
      • saxParserFactoryClass

        private java.lang.String saxParserFactoryClass
      • xmlReaderSupplier

        private java.util.function.Supplier<org.xml.sax.XMLReader> xmlReaderSupplier
      • fixWindowsSystemIdentifiers

        private java.lang.Boolean fixWindowsSystemIdentifiers
    • 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

      • getConfigProperty

        private java.lang.String getConfigProperty​(java.lang.String name)
      • loadConfiguration

        private void loadConfiguration​(java.util.List<java.net.URL> propertyFiles,
                                       java.util.List<java.lang.String> catalogFiles)
      • loadSystemPropertiesConfiguration

        private void loadSystemPropertiesConfiguration()
      • loadPropertiesConfiguration

        private void loadPropertiesConfiguration​(java.net.URL propertiesURL,
                                                 java.util.Properties properties)
      • showConfig

        private void showConfig()
      • 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
      • showConfigChange

        private void showConfigChange​(java.lang.String message)
      • showConfigChange

        private void showConfigChange​(java.lang.String message,
                                      java.lang.Object value)
      • findClasspathCatalogFiles

        private java.util.List<java.lang.String> findClasspathCatalogFiles()
      • 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.
      • isTrue

        private static boolean isTrue​(java.lang.String aString)