de.keepondreaming.xml.util
Class Util

java.lang.Object
  extended by de.keepondreaming.xml.util.Util

public class Util
extends java.lang.Object

Various helper methods $Author: wintermond $ $Date: 2005/07/10 18:32:11 $ $Log: Util.java,v $ Revision 1.4 2005/07/10 18:32:11 wintermond Revamp to improve performance, most operations could benefit from the use of HashMaps Revision 1.3 2005/07/09 14:11:16 wintermond Changed method signatur of createObject - switched parameter ordering Revision 1.2 2005/07/09 10:02:19 wintermond Received some generic methods from the other classes, concerning reflection based topics


Constructor Summary
Util()
           
 
Method Summary
static java.lang.String capitalize(java.lang.String in)
          Uppercases the first letter of a string if in is not null
static java.lang.Class computePrimitiveClass(java.lang.Object primitive)
          Retrieves for an object assignable to a primitive value the assigned primitive class type.
static java.lang.Object createObject(java.lang.Class transformer, java.lang.String value)
          Creates a new instances of an object, if the object has a constructor with a single String parameter
static java.lang.Object createPrimitiveDefaultValue(java.lang.Class primitiveClass)
          Creates for a primitive class an object of the corresponding object type.
static java.lang.Object getPrimitiveObject(java.lang.Class primitive, java.lang.String value)
          Returns a new Object of the concurrent primitive type passed by primitive and initializes it with value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

capitalize

public static java.lang.String capitalize(java.lang.String in)
Uppercases the first letter of a string if in is not null

Parameters:
in -
Returns:
The input string with the first letter as uppercase

createPrimitiveDefaultValue

public static java.lang.Object createPrimitiveDefaultValue(java.lang.Class primitiveClass)
Creates for a primitive class an object of the corresponding object type.

Parameters:
primitiveClass -
Returns:
A newly created Object of the requested type, initialized with default values

getPrimitiveObject

public static java.lang.Object getPrimitiveObject(java.lang.Class primitive,
                                                  java.lang.String value)
Returns a new Object of the concurrent primitive type passed by primitive and initializes it with value

Parameters:
primitive -
value -
Returns:
A new Object of the concurrent primitive type, null if an error occurs

createObject

public static java.lang.Object createObject(java.lang.Class transformer,
                                            java.lang.String value)
Creates a new instances of an object, if the object has a constructor with a single String parameter

Parameters:
transformer -
value -
Returns:
A new instance of the specified class or null if an error occurs

computePrimitiveClass

public static java.lang.Class computePrimitiveClass(java.lang.Object primitive)
Retrieves for an object assignable to a primitive value the assigned primitive class type.

Parameters:
primitive -
Returns:
Primitive class type of the passed primitive object. Null if there is no primitive class for this type available


Copyright © -2005 . All Rights Reserved.