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.
  • Method Details

    • getSchemaForURI

      SchemaDescription getSchemaForURI(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 or null 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 the NamespaceUtil.

      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

      Parses a RelaxNG file from the inputstream and reports namespaces with corresponding prefixes to the callback interface.
      Parameters:
      input - a RelaxNG file
      namespaceCallback - 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.