public class Classes
extends java.lang.Object
Constructor and Description |
---|
Classes() |
Modifier and Type | Method and Description |
---|---|
static java.lang.reflect.Field |
getAnyField(java.lang.Class<?> cls,
java.lang.String name)
Gets the specified field by searching all fields including
any access control and any base class.
|
public static final java.lang.reflect.Field getAnyField(java.lang.Class<?> cls, java.lang.String name) throws java.lang.NoSuchFieldException
Note: public fields don't be treated different. If the caller wants to search public fields first, it has to call Class.getField first.
cls
- the class to searchname
- the field namejava.lang.NoSuchFieldException
- if a matching field is not found.java.lang.SecurityException
- if access to the information is denied.#getAccessibleObject(Class, String, Class[], int)
,
#getAnyMethod(Class, String, Class[])
Copyright © 2005-2010 Potix Corporation. All Rights Reserved.