JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.aspects.persistence
Class ValueConverter

java.lang.Object
  |
  +--org.objectweb.jac.aspects.persistence.ValueConverter

public class ValueConverter
extends Object

General converter for all Objects.

It converts Objects into Strings to store them for persistence, and converts stored Strings into their original form for new use.


Constructor Summary
ValueConverter()
           
 
Method Summary
static String objectToString(Object obj)
          Returns a string representation of a field so that it can be stored.
static Object stringToObject(String str)
          Returns an object from a string, depending on the needed type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueConverter

public ValueConverter()
Method Detail

objectToString

public static String objectToString(Object obj)
Returns a string representation of a field so that it can be stored.

Parameters:
obj - a persistent or primitive object
Returns:
a ready to store string representation

stringToObject

public static Object stringToObject(String str)
Returns an object from a string, depending on the needed type.

Parameters:
str - the type and value in a string format (type:value)
Returns:
an object value deduced from the string representation and from the needed type

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli