Find the getter of the specified property in the type.
@param clazz         The class.
@param property      The property.
@return              The getter method if found. Throws exception if no getter is matched.
438797
public static Method find(TypeDef clazz, Property property) {
        return find(clazz, property, false);
    }
100235
public String getPropertyIn(Collection<?> collection, String property) throws Exception {
    StringBuilder sb = new StringBuilder();
    if (null != collection) {
      for (Iterator<?> iter = collection.iterator(); iter.hasNext();) {
        Object one = iter.next();
        sb.append(extract(one, property)).append(",");
      }
    }
    // 删除逗号
    if (sb.length() > 0) {
      sb.deleteCharAt(sb.length() - 1);
    }
    return sb.toString();
  }
487900
public static <A extends Annotation> A findAnnotation(Class<?> clazz, Class<A> annotationType) {
		if (clazz == null) throw new IllegalArgumentException("Clazz parameter can't be null");
		
		A annotation = clazz.getAnnotation(annotationType);
		if (annotation != null) return annotation;
		
		for (Class<?> ifc : clazz.getInterfaces()) {
			annotation = findAnnotation(ifc, annotationType);
			if (annotation != null) return annotation;
		}
		
		if (!Annotation.class.isAssignableFrom(clazz))
			for (Annotation ann : clazz.getAnnotations()) {
				annotation = findAnnotation(ann.annotationType(), annotationType);
				if (annotation != null) return annotation;
			}
		
		Class<?> superClass = clazz.getSuperclass();
		if (superClass == null || superClass == Object.class) return null;
		return findAnnotation(superClass, annotationType);
	}
755159
public static Map<String, Method> getGetters(Class<?> clazz) {
		Map<String, Method> getters = new HashMap<String, Method>();
		Method[] methods = clazz.getMethods();
		for (Method method : methods) {
			String methodName = method.getName();
			if (method.getParameterTypes().length == 0) {
				if (methodName.startsWith("get") && methodName.length() > 3) {
					String propertyName = methodName.substring(3, 4)
							.toLowerCase();
					if (methodName.length() > 4) {
						propertyName += methodName.substring(4);
					}
					getters.put(propertyName, method);
				} else if (methodName.startsWith("is")
						&& methodName.length() > 2
						&& Boolean.TYPE.equals(method.getReturnType())) {
					String propertyName = methodName.substring(2, 3)
							.toLowerCase();
					if (methodName.length() > 3) {
						propertyName += methodName.substring(3);
					}
					getters.put(propertyName, method);
				}
			}
		}
		return getters;
	}
544257
public Object getProperty(String property) {
        try {
            return getProxyBuilder().doGetProperty(property);
        } catch (MissingPropertyException mpe) {
            if ((getContext() != null) && (getContext().containsKey(property))) {
                return getContext().get(property);
            } else {
                try {
                    return getMetaClass().getProperty(this, property);
                } catch(MissingPropertyException mpe2) {
                    if(mpe2.getProperty().equals(property) && propertyMissingDelegate != null) {
                        return propertyMissingDelegate.call(new Object[]{property});
                    }
                    throw mpe2;
                }
            }
        }
    }
326264
public Boolean getAsBoolean(String property) {
		if (super.has(property)) {
			return get(property).getAsBoolean();
		}
		return null;
	}
264961
public static Method getReadMethod(Class<?> clazz, String propertyName) {
        Method readMethod = null;
        try {
            PropertyDescriptor[] thisProps = Introspector.getBeanInfo(clazz).getPropertyDescriptors();
            for (PropertyDescriptor pd : thisProps) {
                if (pd.getName().equals(propertyName) && pd.getReadMethod() != null) {
                    readMethod = pd.getReadMethod();
                    break;
                }
            }
        } catch (IntrospectionException ex) {
            Logger.getLogger(BeanUtils.class.getName()).log(Level.SEVERE, null, ex);
        }
        return readMethod;
    }
297561
public <T> T getProperty(final String name, final Class<T> clazz) {
        if (containsProperty(name)) {
            val item = this.properties.get(name);
            if (item == null) {
                return null;
            }
            if (!clazz.isAssignableFrom(item.getClass())) {
                throw new ClassCastException("Object [" + item + " is of type " + item.getClass() + " when we were expecting " + clazz);
            }
            return (T) item;
        }
        return null;
    }
1165046
public static Field getPropertyField(Class<?> clazz, String propertyPath) {
		
		Field propertyField = null;
		try {
			String[] properties = propertyPath.split("\\.");
			Field carField = getDeclaredFieldInHierarchy(clazz, properties[0]); 
			if (properties.length == 1) {
				propertyField = carField;
			} else {
				String cdr = StringUtils.arrayToDelimitedString(
						Arrays.copyOfRange(properties, 1, properties.length), ".");
				propertyField = getPropertyField(carField.getType(), cdr);
			}
		} catch (Exception e) {
			throw new IllegalArgumentException("Error accessing propertyPath: " + propertyPath + 
					" on class: " + clazz.getName(), e);
		}
		return propertyField;
	}
1012469
@Override
	public Object getProperty(String property) {
		if (property.equals(PROPERTY_XMLDECL_VERSION)) {
			return version;
		} else if (property.equals(PROPERTY_XMLDECL_STANDALONE)) {
			return standalone;
		} else if (property.equals(PROPERTY_LOCATION)) {
			return location != null ? location : reader.toString();
		} else {
			return null;
		}
	}
459212
public final Class<?> getPropertyType(String property) {
    MethodInfo info = propertyWriteMethods.get(property);
    if (null == info) return null;
    else return info.parameterTypes[0];
  }
557261
public static final Object getValue(Object bean, String property)
    {
        return doFor(bean, property, null, BeanHelper::getValue, BeanHelper::getValue, BeanHelper::getFieldValue, BeanHelper::getMethodValue);
    }
965049
public Object getProperty(String property) {
        try {
            Object key = lookupKeyIgnoringCase(property);
            if (key != null) {
                return result.get(key);
            }
            throw new MissingPropertyException(property, GroovyRowResult.class);
        }
        catch (Exception e) {
            throw new MissingPropertyException(property, GroovyRowResult.class, e);
        }
    }
1266267
public static Class<?> getPropertyClass(Class<?> clazz, List<String> propertyPath) {
		Class<?> current = clazz;
		for (String propertyName : propertyPath) {
			current = getPropertyClass(current, propertyName);
		}
		return current;
	}
132808
public <T> T get(String key, Class<T> clazz, T defaultValue) {
        Object obj = argMap.get(key);
        if (obj == null) {
            return defaultValue;
        }
        return Reflection.toType(obj, clazz);
    }
62166
public Object getProperty(String property) {
        /** @todo we should check if we have the property with the metaClass instead of try/catch  */
        try {
            return super.getProperty(property);
        }
        catch (MissingPropertyException e) {
            return getVariable(property);
        }
    }
407458
@Override
    public Object find(Class clazz, Object key)
    {
        s = getStatelessSession();

        Object result = null;
        try
        {
            result = s.get(clazz, (Serializable) key);
        }
        catch (ClassCastException ccex)
        {
            log.error("Class can not be serializable, Caused by {}.", ccex);
            throw new KunderaException(ccex);
        }
        catch (Exception e)
        {
            log.error("Error while finding, Caused by {}. ", e);
            throw new KunderaException(e);
        }
        return result;

    }