org.modeldriven.fuml.common.reflect
Class ReflectionUtils

java.lang.Object
  extended by org.modeldriven.fuml.common.reflect.ReflectionUtils

public class ReflectionUtils
extends Object


Constructor Summary
ReflectionUtils()
           
 
Method Summary
static Method findMethod(Class<?> target, String name, Class<?> arg)
           
static Method findMethod(Method[] methods, String name, Class<?> arg)
           
static Method getMethod(Class<?> target, String name, Class<?> arg)
           
static Object instanceForName(String qualifiedName)
           
static Object instanceForName(String qualifiedName, Object[] args, Class<?>[] types)
           
static Object invokePublicGetterOrField(Object target, String propertyName)
           
static void invokePublicSetterOrField(Object target, String propertyName, Class<?> javaType, Object value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionUtils

public ReflectionUtils()
Method Detail

findMethod

public static Method findMethod(Class<?> target,
                                String name,
                                Class<?> arg)
                         throws NoSuchMethodException
Throws:
NoSuchMethodException

getMethod

public static Method getMethod(Class<?> target,
                               String name,
                               Class<?> arg)
                        throws NoSuchMethodException
Throws:
NoSuchMethodException

findMethod

public static Method findMethod(Method[] methods,
                                String name,
                                Class<?> arg)

instanceForName

public static Object instanceForName(String qualifiedName)
                              throws ClassNotFoundException,
                                     NoSuchMethodException,
                                     InvocationTargetException,
                                     IllegalAccessException,
                                     InstantiationException
Throws:
ClassNotFoundException
NoSuchMethodException
InvocationTargetException
IllegalAccessException
InstantiationException

instanceForName

public static Object instanceForName(String qualifiedName,
                                     Object[] args,
                                     Class<?>[] types)
                              throws ClassNotFoundException,
                                     NoSuchMethodException,
                                     InvocationTargetException,
                                     IllegalAccessException,
                                     InstantiationException
Throws:
ClassNotFoundException
NoSuchMethodException
InvocationTargetException
IllegalAccessException
InstantiationException

invokePublicGetterOrField

public static Object invokePublicGetterOrField(Object target,
                                               String propertyName)
                                        throws IllegalArgumentException,
                                               IllegalAccessException,
                                               InvocationTargetException
Throws:
IllegalArgumentException
IllegalAccessException
InvocationTargetException

invokePublicSetterOrField

public static void invokePublicSetterOrField(Object target,
                                             String propertyName,
                                             Class<?> javaType,
                                             Object value)
                                      throws IllegalArgumentException,
                                             IllegalAccessException,
                                             InvocationTargetException
Throws:
IllegalArgumentException
IllegalAccessException
InvocationTargetException


Copyright © 2012. All Rights Reserved.