blackboard.persist
Class DataType

java.lang.Object
  extended by blackboard.persist.DataType

public class DataType
extends java.lang.Object

The DataType class provides a means of encapsulating the type of data objects as defined within the persistence framework.

Since:
Bb 5.5
Version:
$Revision: #1 $ $Date: 2005/06/27 $

Field Summary
static DataType NULL_DATA_TYPE
           
 
Constructor Summary
DataType(java.lang.Class typeClass)
          Creates a new DataType object with the given class value as the unique data type identifier.
DataType(java.lang.String name)
          Deprecated. Use DataType(Class) instead.
 
Method Summary
 boolean equals(java.lang.Object object)
          Indicates whether the given object is "equal to" this one.
 java.lang.String getName()
          Returns the identifier name for this DataType as a String.
static java.lang.String toDbLoaderType(DataType dataType)
          Returns a loader type key that can be use for retrieving a database loader (from an appropriate persistence manager -- see below) capable of handling objects with the given data type (see BbObject.getDataType()).
static java.lang.String toDbPersisterType(DataType dataType)
          Returns a persister type key that can be use for retrieving a database persister (from an appropriate persistence manager -- see below) capable of handling objects with the given data type (see BbObject.getDataType()).
 java.lang.String toString()
          Returns the contents of this DataType object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_DATA_TYPE

public static final DataType NULL_DATA_TYPE
Constructor Detail

DataType

public DataType(java.lang.String name)
Deprecated. Use DataType(Class) instead.

This method has been replaced by DataType(Class).


DataType

public DataType(java.lang.Class typeClass)
Creates a new DataType object with the given class value as the unique data type identifier. Use the java keyword class for an easier way to generate the Class value, such as:

 DataType dataType = new DataType( Announcement.class );
 

Parameters:
typeClass - the Class value to use as the data type identifier. This Class value is the class value of the object that this DataType is designed to represent.
Method Detail

equals

public boolean equals(java.lang.Object object)
Indicates whether the given object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
object - the reference object with which to compare

getName

public java.lang.String getName()
Returns the identifier name for this DataType as a String.

Returns:
the identifying name for this data type as a String

toString

public java.lang.String toString()
Returns the contents of this DataType object. This method can be used for debug purposes.

Overrides:
toString in class java.lang.Object
Returns:
a String that represents the contents of this object

toDbLoaderType

public static java.lang.String toDbLoaderType(DataType dataType)
Returns a loader type key that can be use for retrieving a database loader (from an appropriate persistence manager -- see below) capable of handling objects with the given data type (see BbObject.getDataType()).

This method uses the default database persistence manager (as determined by context) for performing the translation (data type to loader type). As such, the returned value is only relevant for use against that persistence manager.

Parameters:
dataType - the DataType of the data object that a necessary loader type key value should be returned for
Returns:
the appropriate loader type key value as a String
Since:
Bb 6.0.11

toDbPersisterType

public static java.lang.String toDbPersisterType(DataType dataType)
Returns a persister type key that can be use for retrieving a database persister (from an appropriate persistence manager -- see below) capable of handling objects with the given data type (see BbObject.getDataType()).

This method uses the default database persistence manager (as determined by context) for performing the translation (data type to persister type). As such, the returned value is only relevant for use against that persistence manager.

Parameters:
dataType - the DataType of the data object that a necessary persister type key value should be returned for
Returns:
the appropriate persister type key value as a String
Since:
Bb 6.0.11


Copyright © 2003 Blackboard, Inc. All Rights Reserved.