Package com.adobe.xmp.schema.service
Interface SchemaService
-
public interface SchemaService
Interface for a service to provide schema information for XMP schemas and properties. A simple property path of QNames, '/' separators and array indices '[xxx]' can be used to determine a properties type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SchemaService.INamespaceCallback
An interface to report prefix/namespace bindings during Relax NG parsing.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PropertyDescription
getProperty(XMPPath propertyPath)
Retrieves the property description for all kinds of properties for a given XMP path.SchemaDescription
getSchemaForURI(java.lang.String ns)
Request the schema information for a namespace.PropertyType
getType(XMPPath propertyPath)
Provides the type information for a single property (simple, array (and item type), struct or qualifier) for a given XMP path.SchemaDescription
parseRelaxNG(java.io.InputStream input, SchemaService.INamespaceCallback namespaceCallback)
Parses a RelaxNG file from the inputstream and reports namespaces with corresponding prefixes to the callback interface.
-
-
-
Method Detail
-
getSchemaForURI
SchemaDescription getSchemaForURI(java.lang.String ns) throws SchemaServiceException
Request the schema information for a namespace.- Parameters:
ns
- a namespace URI, e.g. "http://purl.org/dc/elements/1.1/" for Dublin Core- Returns:
- Returns a
SchemaDescription
ornull
if it is not available. - Throws:
SchemaServiceException
- Forwards exceptions that occur during schema file loading and parsing.
-
getType
PropertyType getType(XMPPath propertyPath) throws SchemaServiceException
Provides the type information for a single property (simple, array (and item type), struct or qualifier) for a given XMP path. Note: Qualifiers are currently not supported. The prefixes used in the property paths are resolved using theNamespaceUtil
.Examples:
- dc:Rating -- a simple property type
- exif:Flash/exif:Fired -- a "struct" containing a simple "boolean" property
- dc:subject -- an "Alt-array" with item type "Text"
- dc:subject[3] -- the item type of the array, which is "Text". Note The array index is ignored and can also be left out "[]"
- Parameters:
propertyPath
-XMPPath
which identifies the property- Returns:
- Returns the property type for the requested property,
or
null if the property is not part of the schema and no type information is available. An exception is thrown, if the path is syntactically not correct.
null
is returned if path is not accessible (e.g. child property of a simple property). - Throws:
SchemaServiceException
- Reports errors during the retrieval of schema or type information.
-
getProperty
PropertyDescription getProperty(XMPPath propertyPath) throws SchemaServiceException
Retrieves the property description for all kinds of properties for a given XMP path. Note: Qualifiers are currently not supported.- Parameters:
propertyPath
-XMPPath
which identifies the property- Returns:
- Returns the property description for the requested property,
or
null if the property is not part of the schema and no type information is available. An exception is thrown, if the path is syntactically not correct.
null
is returned if path is not accessible (e.g. child property of a simple property). - Throws:
SchemaServiceException
- Reports errors during the retrieval of schema or type information.
-
parseRelaxNG
SchemaDescription parseRelaxNG(java.io.InputStream input, SchemaService.INamespaceCallback namespaceCallback) throws SchemaServiceException
Parses a RelaxNG file from the inputstream and reports namespaces with corresponding prefixes to the callback interface.- Parameters:
input
- a RelaxNG filenamespaceCallback
- a callback function to report the namespaces found during parsing- Returns:
- Returns a
SchemaDescription
- Throws:
SchemaServiceException
- Reports errors during the retrieval of schema or type information.
-
-