Package com.adobe.xmp.schema.service
Class StandardRelaxNGProvider
- java.lang.Object
-
- com.adobe.xmp.schema.service.StandardRelaxNGProvider
-
- All Implemented Interfaces:
RelaxNGProvider
public class StandardRelaxNGProvider extends Object implements RelaxNGProvider
The standard RelaxNG-provider provides access to standard Relax-NG resources present inside this bundle.
-
-
Constructor Summary
Constructors Constructor Description StandardRelaxNGProvider()
Default constructor which uses the default manifest file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStream
getInclude(String includeName)
Provides a RelaxNG include, referenced by its nameSet<String>
getNamespaces()
Returns a list of all schema namespaces that this provider can deliver.Map<XMPPath,Map<QName,Map<String,String>>>
getRuntimeDecorators()
No default runtime decorators.InputStream
getSchema(String namespaceURI)
Provides a RelaxNG resource by its namespace URI.boolean
isAvailable(String namespaceURI)
Checks if a schema (identified by its URI) can be provided.
-
-
-
Constructor Detail
-
StandardRelaxNGProvider
public StandardRelaxNGProvider() throws SchemaServiceException
Default constructor which uses the default manifest file.- Throws:
SchemaServiceException
- Thrown if the input files are not found or could not be loaded.
-
-
Method Detail
-
getSchema
public InputStream getSchema(String namespaceURI) throws IOException
Description copied from interface:RelaxNGProvider
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 callRelaxNGProvider.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).- Specified by:
getSchema
in interfaceRelaxNGProvider
- Parameters:
namespaceURI
- the namespace URI of the schema according to the XMP specification- Returns:
- Returns the RelaxNG resource as stream
- Throws:
IOException
- Forwards exceptions that occur during schema file loading.- See Also:
RelaxNGProvider.getSchema(java.lang.String)
-
getInclude
public InputStream getInclude(String includeName) throws IOException
Description copied from interface:RelaxNGProvider
Provides a RelaxNG include, referenced by its name- Specified by:
getInclude
in interfaceRelaxNGProvider
- Returns:
- Returns the RelaxNG resource as stream or
null
if it has not been found. - Throws:
IOException
- Forwards exceptions that occur during schema file loading.- See Also:
RelaxNGProvider.getInclude(java.lang.String)
-
isAvailable
public boolean isAvailable(String namespaceURI)
Description copied from interface:RelaxNGProvider
Checks if a schema (identified by its URI) can be provided. The result of this call has to be symmetric toRelaxNGProvider.getSchema(String)
. Note: For all namespaces where isAvailable() returnstrue
, 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.- Specified by:
isAvailable
in interfaceRelaxNGProvider
- 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.
- See Also:
RelaxNGProvider.isAvailable(java.lang.String)
-
getNamespaces
public Set<String> getNamespaces()
Description copied from interface:RelaxNGProvider
Returns a list of all schema namespaces that this provider can deliver.- Specified by:
getNamespaces
in interfaceRelaxNGProvider
- Returns:
- Returns a list of all available schema namespaces of this provider.
- See Also:
RelaxNGProvider.getNamespaces()
-
getRuntimeDecorators
public Map<XMPPath,Map<QName,Map<String,String>>> getRuntimeDecorators()
No default runtime decorators.- Specified by:
getRuntimeDecorators
in interfaceRelaxNGProvider
- Returns:
- See Also:
RelaxNGProvider.getRuntimeDecorators()
-
-