Class ResourceResolver


  • public class ResourceResolver
    extends Object
    During reference validation, we have to retrieve resources from somewhere. This is done by retrieving a Resolver. The resolver needs two arguments: The URI in which the link to the new resource is defined and the baseURI of the file/entity in which the URI occurs (the baseURI is the same as the SystemId).
    • Constructor Detail

      • ResourceResolver

        public ResourceResolver​(ResourceResolverSpi resourceResolver)
        Constructor ResourceResolver
        Parameters:
        resourceResolver -
    • Method Detail

      • register

        public static void register​(String className)
        Registers a ResourceResolverSpi class. This method LOGs a warning if the class cannot be registered.
        Parameters:
        className - the name of the ResourceResolverSpi class to be registered
        Throws:
        SecurityException - if a security manager is installed and the caller does not have permission to register a resource resolver
      • registerAtStart

        public static void registerAtStart​(String className)
        Registers a ResourceResolverSpi class at the beginning of the provider list. This method LOGs a warning if the class cannot be registered.
        Parameters:
        className - the name of the ResourceResolverSpi class to be registered
        Throws:
        SecurityException - if a security manager is installed and the caller does not have permission to register a resource resolver
      • register

        public static void register​(Class<? extends ResourceResolverSpi> className,
                                    boolean start)
        Registers a ResourceResolverSpi class. This method LOGs a warning if the class cannot be registered.
        Parameters:
        className -
        start -
        Throws:
        SecurityException - if a security manager is installed and the caller does not have permission to register a resource resolver
      • register

        public static void register​(ResourceResolverSpi resourceResolverSpi,
                                    boolean start)
        Registers a ResourceResolverSpi instance. This method LOGs a warning if the class cannot be registered.
        Parameters:
        resourceResolverSpi -
        start -
        Throws:
        SecurityException - if a security manager is installed and the caller does not have permission to register a resource resolver
      • registerDefaultResolvers

        public static void registerDefaultResolvers()
        This method registers the default resolvers.
      • setProperty

        public void setProperty​(String key,
                                String value)
        Method setProperty
        Parameters:
        key -
        value -
      • getProperty

        public String getProperty​(String key)
        Method getProperty
        Parameters:
        key -
        Returns:
        the value of the property
      • addProperties

        public void addProperties​(Map<String,​String> properties)
        Method addProperties
        Parameters:
        properties -
      • getPropertyKeys

        public String[] getPropertyKeys()
        Method getPropertyKeys
        Returns:
        all property keys.
      • understandsProperty

        public boolean understandsProperty​(String propertyToTest)
        Method understandsProperty
        Parameters:
        propertyToTest -
        Returns:
        true if the resolver understands the property
      • isURISafeToResolve

        public static boolean isURISafeToResolve​(Attr uriAttr,
                                                 String baseUri)