org.owlet.helpers
Class ReflectionHelpers

java.lang.Object
  extended by org.owlet.helpers.ReflectionHelpers

public class ReflectionHelpers
extends java.lang.Object

This class offers a few helpful methods for handling primitive datatypes in the Java Reflection API

Author:
Michael D�nzer

Constructor Summary
ReflectionHelpers()
           
 
Method Summary
static java.lang.Object getCastedObjectFromStringValue(java.lang.String lexicalValue, java.lang.Class type)
          Takes a Class Variable for primitive Datatype or its Wrapper-Classes and a String.
static java.lang.Class getClassFromString(java.lang.String strClass)
          Takes a String and returns a Class Object represented by the value of the String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionHelpers

public ReflectionHelpers()
Method Detail

getCastedObjectFromStringValue

public static java.lang.Object getCastedObjectFromStringValue(java.lang.String lexicalValue,
                                                              java.lang.Class type)
Takes a Class Variable for primitive Datatype or its Wrapper-Classes and a String. Then an instance of the Class (for primitive Datatypes an instance of its Wrapper-Class) is created and the string value is assigned to the instance.

Parameters:
lexicalValue -
type -
Returns:
An instance of type with the assigned lexicalValue

getClassFromString

public static java.lang.Class getClassFromString(java.lang.String strClass)
Takes a String and returns a Class Object represented by the value of the String. This is intended for use with Class.getDeclaredMethods() Returns xx.TYPE Classes for primitive Datatypes

Returns:
Class Object specified by strClass
See Also:
Class.getDeclaredMethod(java.lang.String, java.lang.Class[])


Copyright © 2004 Evren Sirin. All Rights Reserved.