net.jbeans.data.converter
Class DataConverter

java.lang.Object
  extended bynet.jbeans.data.converter.DataConverter
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BasicTypeConverter, NoChangeConverter, PrimitiveToStringConverter, PrimitiveToWrapperConverter, StringToPrimitiveBooleanConverter, StringToPrimitiveByteConverter, StringToPrimitiveDoubleConverter, StringToPrimitiveFloatConverter, StringToPrimitiveIntConverter, StringToPrimitiveLongConverter, StringToPrimitiveShortConverter, WrapperToPrimitiveBooleanConverter, WrapperToPrimitiveByteConverter, WrapperToPrimitiveDoubleConverter, WrapperToPrimitiveFloatConverter, WrapperToPrimitiveIntConverter, WrapperToPrimitiveLongConverter, WrapperToPrimitiveShortConverter

public abstract class DataConverter
extends java.lang.Object
implements java.io.Serializable

generally describe DataConverter in here

Version:
$Revision: 1.1.1.1 $
Author:
Masahiro Takatsuka (masa@jbeans.net)
See Also:
Serializable, Serialized Form

Field Summary
protected  java.lang.Class[] sourceTypes
           
protected  java.lang.Class[] targetTypes
           
 
Constructor Summary
DataConverter()
          Constracts a new MtDataConverter
 
Method Summary
protected abstract  java.lang.Object convert(java.lang.Object obj, java.lang.Class class1)
          Converts the specified object "obj" into an object of a class "class1".
 java.lang.Object convert(java.lang.Object obj, java.lang.String classname)
          Converts the specified object "obj" into an object of a class "class1".
 java.lang.Class[] getSourceDataTypes()
          Returns a list of class which represent classes of source data.
 java.lang.Class[] getTargetDataTypes()
          Returns a class of target data.
 boolean isSourceDataTypeSupported(java.lang.Class class1)
          Checks whether the specified class is supported as a source data type.
 boolean isTargetDataTypeSupported(java.lang.Class class1)
          Checks whether the specified class is supported as a target data type.
protected abstract  void setDataTypes()
          Initializes acceptable soruce and target types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sourceTypes

protected transient java.lang.Class[] sourceTypes

targetTypes

protected transient java.lang.Class[] targetTypes
Constructor Detail

DataConverter

public DataConverter()
Constracts a new MtDataConverter

Method Detail

setDataTypes

protected abstract void setDataTypes()
Initializes acceptable soruce and target types.


getSourceDataTypes

public java.lang.Class[] getSourceDataTypes()
Returns a list of class which represent classes of source data.


getTargetDataTypes

public java.lang.Class[] getTargetDataTypes()
Returns a class of target data.


isSourceDataTypeSupported

public boolean isSourceDataTypeSupported(java.lang.Class class1)
Checks whether the specified class is supported as a source data type.


isTargetDataTypeSupported

public boolean isTargetDataTypeSupported(java.lang.Class class1)
Checks whether the specified class is supported as a target data type.


convert

public java.lang.Object convert(java.lang.Object obj,
                                java.lang.String classname)
                         throws InvalidDataTypeException,
                                UnsupportedTypeException
Converts the specified object "obj" into an object of a class "class1".

Throws:
InvalidDataTypeException
UnsupportedTypeException

convert

protected abstract java.lang.Object convert(java.lang.Object obj,
                                            java.lang.Class class1)
                                     throws InvalidDataTypeException,
                                            UnsupportedTypeException
Converts the specified object "obj" into an object of a class "class1".

Throws:
InvalidDataTypeException
UnsupportedTypeException


Copyright © 2003 JBean project. All Rights Reserved.