org.neodatis.odb.impl.tool
Class ObjectTool

java.lang.Object
  extended by org.neodatis.odb.impl.tool.ObjectTool

public class ObjectTool
extends java.lang.Object

Basic native Object formatter. Used in ODBExplorer and XML import/export.

Author:
osmadja

Field Summary
static OdbDateFormat format
           
static int ID_CALLER_IS_ODB_EXPLORER
           
static int ID_CALLER_IS_SERIALIZER
           
static int ID_CALLER_IS_XML
           
 
Constructor Summary
ObjectTool()
           
 
Method Summary
static java.lang.String atomicNativeObjectToString(AtomicNativeObjectInfo anoi, int caller)
           
static boolean callerIsOdbExplorer(int caller)
           
static boolean callerIsSerializer(int caller)
           
static boolean callerIsXml(int caller)
           
static java.lang.Object stringToObject(int odbTypeId, java.lang.String value, int caller)
          Convert a string representation to the right object
static NativeObjectInfo stringToObjectInfo(int odbTypeId, java.lang.String value, int caller, ClassInfo ci)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

format

public static OdbDateFormat format

ID_CALLER_IS_ODB_EXPLORER

public static int ID_CALLER_IS_ODB_EXPLORER

ID_CALLER_IS_XML

public static int ID_CALLER_IS_XML

ID_CALLER_IS_SERIALIZER

public static int ID_CALLER_IS_SERIALIZER
Constructor Detail

ObjectTool

public ObjectTool()
Method Detail

stringToObject

public static java.lang.Object stringToObject(int odbTypeId,
                                              java.lang.String value,
                                              int caller)
                                       throws java.lang.NumberFormatException,
                                              java.text.ParseException
Convert a string representation to the right object
   If it is a representation of an int, it will return an Integer.
 
 

Parameters:
odbTypeId - The native object type
value - The real value
caller - The caller type , can be one of the constants ObjectTool.CALLER_IS_*
Returns:
The right object
Throws:
java.lang.NumberFormatException
java.text.ParseException

stringToObjectInfo

public static NativeObjectInfo stringToObjectInfo(int odbTypeId,
                                                  java.lang.String value,
                                                  int caller,
                                                  ClassInfo ci)
                                           throws java.lang.NumberFormatException,
                                                  java.text.ParseException
Parameters:
odbTypeId - The native object type
value - The real value
caller - The caller type , can be one of the constants ObjectTool.CALLER_IS_*
ci - The ClassInfo. It is only used for enum where we need the enum class info. In other cases, it is null
Returns:
The NativeObjectInfo that represents the specific value
Throws:
java.lang.NumberFormatException
java.text.ParseException

atomicNativeObjectToString

public static java.lang.String atomicNativeObjectToString(AtomicNativeObjectInfo anoi,
                                                          int caller)

callerIsOdbExplorer

public static boolean callerIsOdbExplorer(int caller)

callerIsXml

public static boolean callerIsXml(int caller)

callerIsSerializer

public static boolean callerIsSerializer(int caller)