org.dvb.tvanytime.metadata
Class ClassificationScheme

java.lang.Object
  extended by org.dvb.tvanytime.metadata.ClassificationScheme

public abstract class ClassificationScheme
extends java.lang.Object

Class representing a TV-Anytime classification scheme. A classification scheme lists a set of termIDs and allows the corresponding ControlledTerms to be obtained.


Method Summary
static ControlledTerm getControlledTerm(Database database, java.lang.String href)
          Get a ControlledTerm object corresponding to a reference obtained from the specified database.
abstract  ControlledTerm getControlledTerm(java.lang.String termID)
          Get a ControlledTerm object corresponding to a termID.
static ClassificationScheme getInstance(Database database, java.lang.String uri)
          Get an instance of a ClassificationScheme referenced by the specified database.
static ClassificationScheme getInstance(java.lang.String uri)
          Get an instance of a inbuilt ClassificationScheme which is supported by the platform.
abstract  java.util.Enumeration getTermIDs()
          Get the termIDs supported by this ClassificationScheme.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ClassificationScheme getInstance(java.lang.String uri)
                                        throws DatabaseException
Get an instance of a inbuilt ClassificationScheme which is supported by the platform.

Parameters:
uri - The URI or the alias name of the inbuilt classification scheme.
Returns:
a ClassificationScheme instance.
Throws:
DatabaseException - if the specified URI is not supported or the alias cannot be resolved

getInstance

public static ClassificationScheme getInstance(Database database,
                                               java.lang.String uri)
                                        throws DatabaseException
Get an instance of a ClassificationScheme referenced by the specified database.

If the reference includes an alias the method will first attempt to resolve this against CSAlias information provided by the database. If this fails it will attempt to resolve it against aliases used for the inbuilt Classication Schemes. If this fails the method will throw a DatabaseException.

If the resolved reference refers to a Classification Scheme that is not supported by the platform the method will try to obtain a downloadable Classification Scheme from the database. If this fails the method will throw a DatabaseException.

Parameters:
database - the metadata service from which the reference was obtained.
uri - the URI or alias name of a classification scheme referenced by the database.
Returns:
a ClassificationScheme.
Throws:
DatabaseException - if the reference cannot be resolved or the required ClassificationScheme cannot be found.

getControlledTerm

public abstract ControlledTerm getControlledTerm(java.lang.String termID)
                                          throws DatabaseException
Get a ControlledTerm object corresponding to a termID.

Parameters:
termID - a String that contains the name of the termID
Returns:
a ControlledTerm object
Throws:
DatabaseException - if the termID is not found in this ClassificationScheme

getControlledTerm

public static ControlledTerm getControlledTerm(Database database,
                                               java.lang.String href)
                                        throws DatabaseException
Get a ControlledTerm object corresponding to a reference obtained from the specified database.

If the reference includes an alias the method will first attempt to resolve this against CSAlias information provided by the database. If this fails it will attempt to resolve it against aliases used for the inbuilt Classication Schemes. If this fails the method will throw a DatabaseException.

If the resolved reference refers to a Classification Scheme that is not supported by the platform the method will try to obtain a downloadable Classification Scheme from the database. If this fails the method will throw a DatabaseException.

Parameters:
database - the database from which the reference was obtained.
href - a reference to a Controlled Term
Returns:
a ControlledTerm object
Throws:
DatabaseException - if the reference cannot be resolved, or the required Classification Scheme cannot be found, or the termID is not found in the ClassificationScheme.

getTermIDs

public abstract java.util.Enumeration getTermIDs()
Get the termIDs supported by this ClassificationScheme.

Returns:
an enumeration of the termIDs.