|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.util.ObjectStringConversion
This class serves as a basic implementation of the ObjectStringConverter interface. It is capable of converting a large number of objects to Strings and vice versa.
Constructor Summary | |
protected |
ObjectStringConversion()
Creates a new instance of ObjectStringConversion |
Method Summary | |
Object |
convertToObject(String o,
Class asClass)
This method takes a String, and tries to interpret it as a String representation of the given classtype, which it will then create. |
String |
convertToString(Object o,
Class asClass)
This method takes an object, treats it as an object of the given class type and produces a String representation. |
static ObjectStringConversion |
getInstance()
Provides access to the singleton instance |
protected void |
registerObjectStringConverter(Class clazz,
ObjectStringConverter s)
Registers another handler for the given class type |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected ObjectStringConversion()
Method Detail |
protected void registerObjectStringConverter(Class clazz, ObjectStringConverter s)
clazz
- the type of classs
- the converterpublic static ObjectStringConversion getInstance()
public Object convertToObject(String o, Class asClass) throws IllegalArgumentException
ObjectStringConverter
convertToObject
in interface ObjectStringConverter
IllegalArgumentException
o
- the String to convertasClass
- the type which should be generated by this method. the method is
free to create a more specific type, but that type must be assignment compatible
public String convertToString(Object o, Class asClass) throws IllegalArgumentException
ObjectStringConverter
convertToString
in interface ObjectStringConverter
IllegalArgumentException
o
- the object to convertasClass
- the type which should be used to interpret the object, may be less specific than
the actual object's type
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |