ReflWrap
Class Refl

java.lang.Object
  extended by ReflWrap.Refl

public class Refl
extends java.lang.Object

This class provides helper functions to the ReflWrap package


Constructor Summary
Refl()
           
 
Method Summary
static java.lang.String arrayType(java.lang.String type)
          Helper function for handling arrays
static java.lang.String arrayType2(java.lang.String type)
          Array handling hack
static boolean[] booleanArray(java.lang.Object data)
           
static byte[] byteArray(java.lang.Object data)
           
static char[] charArray(java.lang.Object data)
           
static java.lang.String class_(java.lang.Class moo)
          Retrieve a code snippet for generating a new object
static java.lang.String convert(java.lang.String type)
          Type conversion helper function
static java.lang.String defaultVal(java.lang.String type)
          Get the default value for a specific type
static java.lang.Object defaultVal2(java.lang.String type)
          Get the default value of a specific type as an Object
static double[] doubleArray(java.lang.Object data)
           
static java.lang.String firstToken(java.lang.String str, java.lang.String tok)
          Retrieves the first matching token from a string
static float[] floatArray(java.lang.Object data)
           
static java.lang.Class getClass(java.lang.String type)
          Get a Class object from a given string
static java.lang.String handleArray(java.lang.String type)
          Handles arrays, which are mangled by the Reflection API
static boolean hasAnot(java.lang.String comp, java.lang.annotation.Annotation[] anot)
          Checks if a certain annotation is present
static boolean hasToken(java.lang.String str, java.lang.String tok)
          Checks if a certain token is present in a string
static int[] intArray(java.lang.Object data)
           
static java.lang.String lastToken(java.lang.String str, java.lang.String tok)
          Retrieves the last matching token from a string
static long[] longArray(java.lang.Object data)
           
static java.lang.Object[] ObjectArray(java.lang.Object data)
           
static java.lang.String printType(java.lang.reflect.Type t)
          Convert a Type object to a string
static java.lang.String rtype(java.lang.Class klass)
          Temporary conversion hack
static short[] shortArray(java.lang.Object data)
           
static java.lang.String[] StringArray(java.lang.Object data)
           
static java.lang.String type(java.lang.String type)
          Returns the class part of a fully-qualified typename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Refl

public Refl()
Method Detail

hasAnot

public static boolean hasAnot(java.lang.String comp,
                              java.lang.annotation.Annotation[] anot)
Checks if a certain annotation is present

Parameters:
comp - Annotation to check for
anot - Array of annotations to check against
Returns:
True if one of the annotations matches comp, false otherwise

rtype

public static java.lang.String rtype(java.lang.Class klass)
Temporary conversion hack

Parameters:
klass - Class to convert
Returns:
Converted code

type

public static java.lang.String type(java.lang.String type)
Returns the class part of a fully-qualified typename

Parameters:
type - Fully-qualified typename
Returns:
Class part of the name

handleArray

public static java.lang.String handleArray(java.lang.String type)
Handles arrays, which are mangled by the Reflection API

Parameters:
type - Type
Returns:
A cleaned-up type

arrayType

public static java.lang.String arrayType(java.lang.String type)
Helper function for handling arrays

Parameters:
type - Type
Returns:
A cleaned-up type

arrayType2

public static java.lang.String arrayType2(java.lang.String type)
Array handling hack

Parameters:
type - Type
Returns:
Array type

getClass

public static java.lang.Class getClass(java.lang.String type)
Get a Class object from a given string

Parameters:
type - Requested class
Returns:
Class object

class_

public static java.lang.String class_(java.lang.Class moo)
Retrieve a code snippet for generating a new object

Parameters:
moo - Class to generate an object for
Returns:
Code

defaultVal

public static java.lang.String defaultVal(java.lang.String type)
Get the default value for a specific type

Parameters:
type - Type
Returns:
Default value

defaultVal2

public static java.lang.Object defaultVal2(java.lang.String type)
Get the default value of a specific type as an Object

Parameters:
type - Type
Returns:
Default value

convert

public static java.lang.String convert(java.lang.String type)
Type conversion helper function

Parameters:
type - Type
Returns:
A cleaned-up type

firstToken

public static java.lang.String firstToken(java.lang.String str,
                                          java.lang.String tok)
Retrieves the first matching token from a string

Parameters:
str - String to look in
tok - Token to look for
Returns:
First matching token

lastToken

public static java.lang.String lastToken(java.lang.String str,
                                         java.lang.String tok)
Retrieves the last matching token from a string

Parameters:
str - String to look in
tok - Token to look for
Returns:
Last matching token

hasToken

public static boolean hasToken(java.lang.String str,
                               java.lang.String tok)
Checks if a certain token is present in a string

Parameters:
str - String to look in
tok - Token to look for
Returns:
True if the token is present, false otherwise

printType

public static java.lang.String printType(java.lang.reflect.Type t)
Convert a Type object to a string

Parameters:
t - Type object
Returns:
String representation of the Type object

booleanArray

public static boolean[] booleanArray(java.lang.Object data)

byteArray

public static byte[] byteArray(java.lang.Object data)

charArray

public static char[] charArray(java.lang.Object data)

doubleArray

public static double[] doubleArray(java.lang.Object data)

floatArray

public static float[] floatArray(java.lang.Object data)

intArray

public static int[] intArray(java.lang.Object data)

longArray

public static long[] longArray(java.lang.Object data)

shortArray

public static short[] shortArray(java.lang.Object data)

StringArray

public static java.lang.String[] StringArray(java.lang.Object data)

ObjectArray

public static java.lang.Object[] ObjectArray(java.lang.Object data)