Interface RelaxNGProvider

  • All Known Implementing Classes:
    StandardRelaxNGProvider

    public interface RelaxNGProvider
    Provides all available RelaxNG schema resources and referenced includes. The returned streams shall contain the Relax NG source files.
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      java.io.InputStream getInclude​(java.lang.String includeName)
      Provides a RelaxNG include, referenced by its name
      java.util.Set<java.lang.String> getNamespaces()
      Deprecated.
      TODO Check if this is really needed.
      java.util.Map<XMPPath,​java.util.Map<javax.xml.namespace.QName,​java.util.Map<java.lang.String,​java.lang.String>>> getRuntimeDecorators()
      Runtime decorators are applied to the schema once it is parsed and are stored in the schema model: The Map key is an XMPPath which models a path such as "xmpDM:duration.xmpDM:scale". The value is another Map, where the keys are QNames of decorators. Each decorator value is a property/value list. Note:
      java.io.InputStream getSchema​(java.lang.String namespaceURI)
      Provides a RelaxNG resource by its namespace URI.
      boolean isAvailable​(java.lang.String namespaceURI)
      Checks if a schema (identified by its URI) can be provided.
    • Method Detail

      • getSchema

        java.io.InputStream getSchema​(java.lang.String namespaceURI)
                               throws java.io.IOException
        Provides a RelaxNG resource by its namespace URI. null is returned if there is no resource available for this namespace. If only the existence shall be checked, the call isAvailable(String) should be used. Note: The provider contains only "top-level" XMP schemas (such as Dublin Core) and no XMP type schemas (such as Dimensions).
        Parameters:
        namespaceURI - the namespace URI of the schema according to the XMP specification
        Returns:
        Returns the RelaxNG resource as stream
        Throws:
        java.io.IOException - Forwards exceptions that occur during schema file loading.
      • getInclude

        java.io.InputStream getInclude​(java.lang.String includeName)
                                throws java.io.IOException
        Provides a RelaxNG include, referenced by its name
        Parameters:
        resourceName - the name of the resource, usually a file name, e.g. "include.rng".
        Returns:
        Returns the RelaxNG resource as stream or null if it has not been found.
        Throws:
        java.io.IOException - Forwards exceptions that occur during schema file loading.
      • isAvailable

        boolean isAvailable​(java.lang.String namespaceURI)
        Checks if a schema (identified by its URI) can be provided. The result of this call has to be symmetric to getSchema(String). Note: For all namespaces where isAvailable() returns true, the method getSchema() has to return a result as well. Note: a call to this method should only check whether the RelaxNG resource is available, and should not already load the resource.
        Parameters:
        namespaceURI - the namespace URI of the schema according to the XMP specification
        Returns:
        Returns true if the schema is registered. This does not imply that it can be loaded successfully.
      • getRuntimeDecorators

        java.util.Map<XMPPath,​java.util.Map<javax.xml.namespace.QName,​java.util.Map<java.lang.String,​java.lang.String>>> getRuntimeDecorators()
        Runtime decorators are applied to the schema once it is parsed and are stored in the schema model:
        • The Map key is an XMPPath which models a path such as "xmpDM:duration.xmpDM:scale".
        • The value is another Map, where the keys are QNames of decorators.
        • Each decorator value is a property/value list.
        Note:
        Returns:
      • getNamespaces

        java.util.Set<java.lang.String> getNamespaces()
        Deprecated.
        TODO Check if this is really needed.
        Returns a list of all schema namespaces that this provider can deliver.
        Returns:
        Returns a list of all available schema namespaces of this provider.