Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.util
Class Convert

java.lang.Object
  extended byorg.evolvica.util.Convert

public class Convert
extends java.lang.Object

Helper for converting objects.

Since:
0.5.0
Version:
$Revision: 1.5 $ $Date: 2004/05/26 11:58:36 $
Author:
Andreas Rummler

Field Summary
static java.lang.String separator
          Separator used for array conversion.
 
Constructor Summary
Convert()
           
 
Method Summary
static boolean isConvertibleFromString(java.lang.Class clazz)
          Checks if a converter for the given class exists.
static boolean isConvertibleToBoolean(java.lang.Class clazz)
          Checks if the given class is a boolean class or type
static java.lang.Class toClass(java.lang.String s)
          Converts the given string into a class object.
static java.lang.Class toClass(java.lang.String s, java.net.URL[] classpath)
          Converts a given string into a class by using the given classpath.
static java.lang.String toClassname(java.lang.Class c)
          Converts the given class into a string representation.
static java.lang.String toClassname(java.lang.Object o)
          Returns a string representation of the class of the given object.
static java.lang.String toDecoratedString(java.lang.Object o)
          Converts the object to a "pretty" string representation.
static java.lang.Object toObject(java.lang.String s, java.lang.Class target)
          Converts a string to an object of the specified target class.
static java.lang.String toString(java.lang.Object o)
          Converts an object to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

separator

public static java.lang.String separator
Separator used for array conversion.

Constructor Detail

Convert

public Convert()
Method Detail

toString

public static final java.lang.String toString(java.lang.Object o)
Converts an object to a string.

Parameters:
o - object to be converted
Returns:
string representation

toDecoratedString

public static final java.lang.String toDecoratedString(java.lang.Object o)
Converts the object to a "pretty" string representation.

Parameters:
o - object to convert
Returns:
string representation

toObject

public static final java.lang.Object toObject(java.lang.String s,
                                              java.lang.Class target)
Converts a string to an object of the specified target class.

Parameters:
s - string to be converted
target - target class
Returns:
converted string

toClassname

public static final java.lang.String toClassname(java.lang.Object o)
Returns a string representation of the class of the given object.

Parameters:
o - object of which the class should be converted to a string
Returns:
string representation

toClassname

public static final java.lang.String toClassname(java.lang.Class c)
Converts the given class into a string representation.

Parameters:
c - class to be converted
Returns:
string representation

toClass

public static final java.lang.Class toClass(java.lang.String s)
Converts the given string into a class object.

Parameters:
s - string to be converted
Returns:
class object

toClass

public static final java.lang.Class toClass(java.lang.String s,
                                            java.net.URL[] classpath)
Converts a given string into a class by using the given classpath.

Parameters:
s - string
classpath - classpath
Returns:
loaded class

isConvertibleFromString

public static final boolean isConvertibleFromString(java.lang.Class clazz)
Checks if a converter for the given class exists.

Parameters:
clazz - class
Returns:
true if a converter exists, false instead

isConvertibleToBoolean

public static final boolean isConvertibleToBoolean(java.lang.Class clazz)
Checks if the given class is a boolean class or type

Parameters:
clazz - class
Returns:
true if the given class is of type Boolean or boolean, false instead

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems