com.mkdoc.schema
Class AbstractSchema

java.lang.Object
  |
  +--com.mkdoc.schema.AbstractSchema
All Implemented Interfaces:
Resolver, Schema
Direct Known Subclasses:
DublinCoreElements, DublinCoreTerms, UKeGMS

public abstract class AbstractSchema
extends java.lang.Object
implements Schema

A base implementation for metadata schemas.

Version:
0.7 2005-06-15
Author:
Philip Shaw

Constructor Summary
AbstractSchema()
           
 
Method Summary
protected  java.lang.String[] copyPrefixes(java.lang.String[] prefixes)
          Copy an array of schema prefixes.
 java.lang.String expandPredicate(java.lang.String predicate)
          Expand an encoded predicate to a URI.
protected abstract  java.lang.String expandPredicate(java.lang.String name, java.lang.String predicate)
          A recursive method to expand a predicate from a dot encoded value.
 java.lang.String expandScheme(java.lang.String scheme)
          Expand an encoded scheme value to a URI.
protected abstract  java.lang.String expandScheme(java.lang.String name, java.lang.String scheme)
          Expand an encoded scheme value to a URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.mkdoc.schema.Schema
getAllPrefixes, getDefaultPrefix, getName, getNamedPredicateProperty, getPredicates, getUri, providesQualifiers, providesQualifiersFor
 

Constructor Detail

AbstractSchema

public AbstractSchema()
Method Detail

expandPredicate

public final java.lang.String expandPredicate(java.lang.String predicate)
Expand an encoded predicate to a URI.

Specified by:
expandPredicate in interface Resolver
Parameters:
predicate - The predicate to expand.
Returns:
The expanded URI reference for the predicate or the original string if it is not matched.
Since:
Version 0.1 2004-12-22

expandPredicate

protected abstract java.lang.String expandPredicate(java.lang.String name,
                                                    java.lang.String predicate)
A recursive method to expand a predicate from a dot encoded value.

Parameters:
name - The initial or remaining part of the encoded predicate, in the form DC.Date, DC.Date.modified, or truncated to Date or modified respectively.
predicate - A copy of the original predicate value to fall back to.
Returns:
The expanded predicate URI, if matched, or the predicate argument.
Since:
Version 0.2 2005-03-10

expandScheme

public final java.lang.String expandScheme(java.lang.String scheme)
Expand an encoded scheme value to a URI.

Specified by:
expandScheme in interface Resolver
Parameters:
scheme - The scheme to expand.
Returns:
The expanded URI reference for the scheme, or the original string if it is not matched.
Since:
Version 0.3 2005-05-24

expandScheme

protected abstract java.lang.String expandScheme(java.lang.String name,
                                                 java.lang.String scheme)
Expand an encoded scheme value to a URI.

Allows recursive handling of schema prefixes.

Parameters:
name - The encoding scheme name to expand. Initially, this may include a schema prefix (i.e. DCTERMS.URI), but may be processed recursively without its schema prefix.
scheme - The original scheme to fall back to if there is no match.
Returns:
The expanded URI reference for the scheme, or the original string if it is not matched.
Since:
Version 0.3 2005-05-24

copyPrefixes

protected final java.lang.String[] copyPrefixes(java.lang.String[] prefixes)
Copy an array of schema prefixes.

Parameters:
prefixes - The master array of schema prefixes.
Returns:
An array of prefixes that may be used with a schema.
Since:
Version 0.5 2005-05-27