Java Reflection Method Getter Get getGetterFromProperty(Class clazz, String property)

Here you can find the source of getGetterFromProperty(Class clazz, String property)

Description

get Getter From Property

License

Open Source License

Declaration

public static Method getGetterFromProperty(Class clazz, String property) throws NoSuchMethodException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.lang.reflect.Method;

public class Main {
    public static Method getGetterFromProperty(Class clazz, String property) throws NoSuchMethodException {
        char[] chars = property.toCharArray();
        chars[0] = Character.toUpperCase(chars[0]);
        return clazz.getMethod("get" + new String(chars));
    }//  w  w w  . j a  v a 2 s  .  c o m
}

Related

  1. getGetterFieldName(Method method)
  2. getGetterFields(final Class clazz)
  3. getGetterFor(Field field)
  4. getGetterFor(Object obj, Field field, Class objClass)
  5. getGetterFromCache(Class clazz)
  6. getGetterMethod(Class containingClass, String propertyName)
  7. getGetterMethod(Class type, String property)
  8. getGetterMethod(Class beanClass, String property)
  9. getGetterMethod(Class c, String field)