API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.lang.reflect. Field View Source
Author(s)
Kenneth Russell
Nakul Saraiya
Since
Version
Serial
Hierarchy
 Object
      AccessibleObject
          Field
Implements
 Member
Subclasses
Description
publicfinal class Field
  A Field provides information about, and dynamic access to, a single field of a class or an interface.
Constructors
pack-private Field (Class declaringClass, String name, Class type, int modifiers, int slot, String signature, byte[] annotations)
Package-private constructor used by ReflectAccess to enable instantiation of these objects in Java code from the java.lang package via sun.reflect.LangReflectAccess.
Methods
Hide/Show inherited methods
pack-private Field copy ()
  Package-private routine (exposed to java.lang.Class via ReflectAccess) which returns a copy of this Field.
public boolean equals (Object obj)
  Compares this Field against the specified object.
public Object get (Object obj) throws IllegalArgumentException IllegalAccessException
  Returns the value of the field represented by this Field, on the specified object.
public T getAnnotation (Class< T> annotationClass) [Overrides AccessibleObject]
 
public Annotation getAnnotations () [Inherited From AccessibleObject]
 
public boolean getBoolean (Object obj) throws IllegalArgumentException IllegalAccessException
  Gets the value of a static or instance boolean field.
public byte getByte (Object obj) throws IllegalArgumentException IllegalAccessException
  Gets the value of a static or instance byte field.
public char getChar (Object obj) throws IllegalArgumentException IllegalAccessException
  Gets the value of a static or instance field of type char or of another primitive type convertible to type char via a widening conversion.
public Annotation getDeclaredAnnotations () [Overrides AccessibleObject]
 
public Class<Object> getDeclaringClass () [Specified in Member]
Returns the Class object representing the class or interface that declares the field represented by this Field object.
public double getDouble (Object obj) throws IllegalArgumentException IllegalAccessException
  Gets the value of a static or instance field of type double or of another primitive type convertible to type double via a widening conversion.
public float getFloat (Object obj) throws IllegalArgumentException IllegalAccessException
  Gets the value of a static or instance field of type float or of another primitive type convertible to type float via a widening conversion.
public Type getGenericType ()
  Returns a Type object that represents the declared type for the field represented by this Field object.
public int getInt (Object obj) throws IllegalArgumentException IllegalAccessException
  Gets the value of a static or instance field of type int or of another primitive type convertible to type int via a widening conversion.
public long getLong (Object obj) throws IllegalArgumentException IllegalAccessException
  Gets the value of a static or instance field of type long or of another primitive type convertible to type long via a widening conversion.
public int getModifiers () [Specified in Member]
  Returns the Java language modifiers for the field represented by this Field object, as an integer.
public String getName () [Specified in Member]
Returns the name of the field represented by this Field object.
public short getShort (Object obj) throws IllegalArgumentException IllegalAccessException
  Gets the value of a static or instance field of type short or of another primitive type convertible to type short via a widening conversion.
public Class<Object> getType ()
  Returns a Class object that identifies the declared type for the field represented by this Field object.
pack-privatestatic String getTypeName (Class type)
public int hashCode ()
  Returns a hashcode for this Field.
public boolean isAccessible () [Inherited From AccessibleObject]
  Get the value of the accessible flag for this object.
public boolean isAnnotationPresent (Class<Annotation> annotationClass) [Inherited From AccessibleObject]
 
public boolean isEnumConstant ()
  Returns true if this field represents an element of an enumerated type; returns false otherwise.
public boolean isSynthetic () [Specified in Member]
  Returns true if this field is a synthetic field; returns false otherwise.
public void set (Object obj, Object value) throws IllegalArgumentException IllegalAccessException
  Sets the field represented by this Field object on the specified object argument to the specified new value.
publicstatic void setAccessible (AccessibleObject array, boolean flag) throws SecurityException [Inherited From AccessibleObject]
  Convenience method to set the accessible flag for an array of objects with a single security check (for efficiency).
public void setAccessible (boolean flag) throws SecurityException [Inherited From AccessibleObject]
  Set the accessible flag for this object to the indicated boolean value.
public void setBoolean (Object obj, boolean z) throws IllegalArgumentException IllegalAccessException
  Sets the value of a field as a boolean on the specified object.
public void setByte (Object obj, byte b) throws IllegalArgumentException IllegalAccessException
  Sets the value of a field as a byte on the specified object.
public void setChar (Object obj, char c) throws IllegalArgumentException IllegalAccessException
  Sets the value of a field as a char on the specified object.
public void setDouble (Object obj, double d) throws IllegalArgumentException IllegalAccessException
  Sets the value of a field as a double on the specified object.
public void setFloat (Object obj, float f) throws IllegalArgumentException IllegalAccessException
  Sets the value of a field as a float on the specified object.
public void setInt (Object obj, int i) throws IllegalArgumentException IllegalAccessException
  Sets the value of a field as an int on the specified object.
public void setLong (Object obj, long l) throws IllegalArgumentException IllegalAccessException
  Sets the value of a field as a long on the specified object.
public void setShort (Object obj, short s) throws IllegalArgumentException IllegalAccessException
  Sets the value of a field as a short on the specified object.
public String toGenericString ()
  Returns a string describing this Field, including its generic type.
public String toString ()
  Returns a string describing this Field.
Fields
Hide/Show inherited fields
publicfinalstatic int DECLARED = "1" [Inherited From Member]
  Identifies the set of declared members of a class or interface.
pack-private boolean override [Inherited From AccessibleObject]
publicfinalstatic int PUBLIC = "0" [Inherited From Member]
  Identifies the set of all public members of a class or interface, including inherited members.
pack-privatefinalstatic sun.reflect.ReflectionFactory reflectionFactory [Inherited From AccessibleObject]
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar