net.sourceforge.jaulp.reflection
Class ReflectionUtils

java.lang.Object
  extended by net.sourceforge.jaulp.reflection.ReflectionUtils

public final class ReflectionUtils
extends java.lang.Object

The Class ReflectionUtils.

Version:
1.0
Author:
Asterios Raptis

Constructor Summary
ReflectionUtils()
           
 
Method Summary
static java.util.List<java.lang.String> getFieldNames(java.lang.Class<?> cls)
          Gets all fieldnames from the given class as an String array.
static java.lang.String[] getMethodNames(java.lang.Class<?> cls)
          Gets all methodnames from the given class as an String array.
static java.util.Map<java.lang.String,java.lang.String> getMethodNamesWithPrefixFromFieldNames(java.util.List<java.lang.String> fieldNames, java.lang.String prefix)
          Generates a Map with the fieldName as key and the method as value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionUtils

public ReflectionUtils()
Method Detail

getMethodNames

public static java.lang.String[] getMethodNames(java.lang.Class<?> cls)
Gets all methodnames from the given class as an String array.

Parameters:
cls - The class object to get the methodnames.
Returns:
Gets all methodnames from the given class as an String array.

getFieldNames

public static java.util.List<java.lang.String> getFieldNames(java.lang.Class<?> cls)
Gets all fieldnames from the given class as an String array.

Parameters:
cls - The class object to get the fieldnames.
Returns:
Gets all fieldnames from the given class as an String array.

getMethodNamesWithPrefixFromFieldNames

public static final java.util.Map<java.lang.String,java.lang.String> getMethodNamesWithPrefixFromFieldNames(java.util.List<java.lang.String> fieldNames,
                                                                                                            java.lang.String prefix)
Generates a Map with the fieldName as key and the method as value. Concatenates the given prefix and the fieldname and puts the result into the map.

Parameters:
fieldNames - A list with the fieldNames.
prefix - The prefix for the methodname.
Returns:
the method names with prefix from field names


Copyright © 2010. All Rights Reserved.