javax.rad.model.datatype
Class BinaryDataType

java.lang.Object
  extended by javax.rad.model.datatype.DataType
      extended by javax.rad.model.datatype.BinaryDataType
All Implemented Interfaces:
Serializable, Cloneable, IDataType

public class BinaryDataType
extends DataType

A BinaryDataType is the data type class of a binary ColumnDefinition.

See Also:
Serialized Form

Field Summary
static int TYPE_IDENTIFIER
          the type identifier.
 
Constructor Summary
BinaryDataType()
          Constructs a BinaryDataType with the maximum Integer size.
BinaryDataType(ICellEditor pCellEditor)
          Constructs a BinaryDataType with the maximum Integer size and the given cell editor.
BinaryDataType(int pSize)
          Constructs a BinaryDataType with the given Integer size.
BinaryDataType(int pSize, ICellEditor pCellEditor)
          Constructs a BinaryDataType with the given Integer size and the given cell editor.
 
Method Summary
 BinaryDataType clone()
          Clone an IDataType.
 int compareTo(Object pObject1, Object pObject2)
          Compares IDataType objects in the rules of the Comparable interface. Implementations need to take care about to null objects are equal.
 Object convertAndCheckToTypeClass(Object pObject)
          Converts the oObject to an Object which is an instance of the class which is handled by IDataType.
 String convertToString(Object pObject)
          Converts the oObject into a String which represents the Object.
 Object convertToTypeClass(Object pObject)
          Converts the oObject to an Object which is an instance of the class which is handled by IDataType.
static byte[] getContent(Object pBinaryObject)
          Get's the content to the given object.
 Class getTypeClass()
          Returns the class of the Object's handled by IDataType.
 int getTypeIdentifier()
          Gets the data type identifier.
 Object prepareValue(Object pObject)
          Prepares the given value.

This is used for preparing values for client-side usage and occurs before the client side receives the value for the first time.

If there is nothing to be done, the same object as passed in needs to be returned.

 
Methods inherited from class javax.rad.model.datatype.DataType
getCellEditor, getCellRenderer, getSize, hashCode, setCellEditor, setCellRenderer, setSize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_IDENTIFIER

public static final int TYPE_IDENTIFIER
the type identifier.

See Also:
Constant Field Values
Constructor Detail

BinaryDataType

public BinaryDataType()
Constructs a BinaryDataType with the maximum Integer size.


BinaryDataType

public BinaryDataType(int pSize)
Constructs a BinaryDataType with the given Integer size.

Parameters:
pSize - the size

BinaryDataType

public BinaryDataType(ICellEditor pCellEditor)
Constructs a BinaryDataType with the maximum Integer size and the given cell editor.

Parameters:
pCellEditor - the cell editor

BinaryDataType

public BinaryDataType(int pSize,
                      ICellEditor pCellEditor)
Constructs a BinaryDataType with the given Integer size and the given cell editor.

Parameters:
pSize - the size
pCellEditor - the cell editor
Method Detail

getTypeIdentifier

public int getTypeIdentifier()
Gets the data type identifier.

Returns:
a unique type identifier

getTypeClass

public Class getTypeClass()
Returns the class of the Object's handled by IDataType.

Returns:
the class of the Object's handled by IDataType.

convertAndCheckToTypeClass

public Object convertAndCheckToTypeClass(Object pObject)
                                  throws ModelException
Converts the oObject to an Object which is an instance of the class which is handled by IDataType. The resulting Object is also checked against the type attributes like size, precision,...

Parameters:
pObject - the source Object to convert
Returns:
the converted Object that is instance of the class which is handled by IDataType.
Throws:
ModelException - if the Object is outside the limits of the DataType attributes

convertToString

public String convertToString(Object pObject)
Converts the oObject into a String which represents the Object.

Parameters:
pObject - the source Object to convert
Returns:
the String representation of the source Object

convertToTypeClass

public Object convertToTypeClass(Object pObject)
                          throws ModelException
Converts the oObject to an Object which is an instance of the class which is handled by IDataType.

Parameters:
pObject - the source Object to convert
Returns:
the converted Object that is instance of the class which is handled by IDataType.
Throws:
ModelException - if the class/type of oObject is not supported

compareTo

public int compareTo(Object pObject1,
                     Object pObject2)
Compares IDataType objects in the rules of the Comparable interface. Implementations need to take care about to null objects are equal.

Specified by:
compareTo in interface IDataType
Overrides:
compareTo in class DataType
Parameters:
pObject1 - a getTypeClass() object of one IDataType
pObject2 - a getTypeClass() object of one IDataType
Returns:
-1 if pObject1 is smaller, 0 if equal and +1 if it is greater then pObject2

clone

public BinaryDataType clone()
Clone an IDataType.

Specified by:
clone in interface IDataType
Overrides:
clone in class DataType
Returns:
a clone of this IDataType
See Also:
Object.clone()

prepareValue

public Object prepareValue(Object pObject)
                    throws ModelException
Prepares the given value.

This is used for preparing values for client-side usage and occurs before the client side receives the value for the first time.

If there is nothing to be done, the same object as passed in needs to be returned.

Specified by:
prepareValue in interface IDataType
Overrides:
prepareValue in class DataType
Parameters:
pObject - the object to prepare.
Returns:
the prepared object. If there is nothing to do, the same object.
Throws:
ModelException - if the preparation failed.

getContent

public static final byte[] getContent(Object pBinaryObject)
                               throws IOException
Get's the content to the given object.

Parameters:
pBinaryObject - the object
Returns:
the byte[]
Throws:
IOException - if it fails.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.