| Method from java.lang.reflect.Field Detail: |
public boolean equals(Object obj) {
if (obj instanceof Field) {
Field that = (Field)obj;
if (data.vm_member_id == that.data.vm_member_id) {
assert getDeclaringClass() == that.getDeclaringClass()
&& getName() == that.getName();
return true;
}
}
return false;
}
|
public Object get(Object obj) throws IllegalArgumentException, IllegalAccessException {
obj = checkGet(VMStack.getCallerClass(0), obj);
return VMField.getObject(obj, data.vm_member_id);
}
|
public T getAnnotation(Class<T> annotationClass) {
if(annotationClass == null) {
throw new NullPointerException();
}
for (Annotation aa : data.getAnnotations()) {
if(aa.annotationType() == annotationClass) {
return (T) aa;
}
}
return null;
}
|
public boolean getBoolean(Object obj) throws IllegalArgumentException, IllegalAccessException {
obj = checkGet(VMStack.getCallerClass(0), obj);
return VMField.getBoolean(obj, data.vm_member_id);
}
|
public byte getByte(Object obj) throws IllegalArgumentException, IllegalAccessException {
obj = checkGet(VMStack.getCallerClass(0), obj);
return VMField.getByte(obj, data.vm_member_id);
}
|
public char getChar(Object obj) throws IllegalArgumentException, IllegalAccessException {
obj = checkGet(VMStack.getCallerClass(0), obj);
return VMField.getChar(obj, data.vm_member_id);
}
|
public Annotation[] getDeclaredAnnotations() {
Annotation a[] = data.getAnnotations();
Annotation aa[] = new Annotation[a.length];
System.arraycopy(a, 0, aa, 0, a.length);
return aa;
}
|
public Class<?> getDeclaringClass() {
return data.declaringClass;
}
|
public double getDouble(Object obj) throws IllegalArgumentException, IllegalAccessException {
obj = checkGet(VMStack.getCallerClass(0), obj);
return VMField.getDouble(obj, data.vm_member_id);
}
|
public float getFloat(Object obj) throws IllegalArgumentException, IllegalAccessException {
obj = checkGet(VMStack.getCallerClass(0), obj);
return VMField.getFloat(obj, data.vm_member_id);
}
|
public Type getGenericType() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException {
if (data.genericType == null) {
data.genericType = Parser.parseFieldGenericType(this, VMGenericsAndAnnotations
.getSignature(data.vm_member_id));
}
return data.genericType;
}
|
long getId() {
return data.vm_member_id;
}
Called by VM to obtain this field's handle. |
public int getInt(Object obj) throws IllegalArgumentException, IllegalAccessException {
obj = checkGet(VMStack.getCallerClass(0), obj);
return VMField.getInt(obj, data.vm_member_id);
}
|
public long getLong(Object obj) throws IllegalArgumentException, IllegalAccessException {
obj = checkGet(VMStack.getCallerClass(0), obj);
return VMField.getLong(obj, data.vm_member_id);
}
|
public int getModifiers() {
return data.modifiers;
}
|
public String getName() {
return data.name;
}
|
public short getShort(Object obj) throws IllegalArgumentException, IllegalAccessException {
obj = checkGet(VMStack.getCallerClass(0), obj);
return VMField.getShort(obj, data.vm_member_id);
}
|
String getSignature() {
return data.descriptor;
}
This method is used by serialization mechanism. |
public Class<?> getType() {
return data.getType();
}
|
public int hashCode() {
return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
}
|
public boolean isEnumConstant() {
return (getModifiers() & ACC_ENUM) != 0;
}
|
public boolean isSynthetic() {
return (getModifiers() & ACC_SYNTHETIC) != 0;
}
|
public void set(Object obj,
Object value) throws IllegalArgumentException, IllegalAccessException {
obj = checkSet(VMStack.getCallerClass(0), obj);
VMField.setObject(obj, data.vm_member_id, value);
}
|
public void setBoolean(Object obj,
boolean value) throws IllegalArgumentException, IllegalAccessException {
obj = checkSet(VMStack.getCallerClass(0), obj);
VMField.setBoolean(obj, data.vm_member_id, value);
}
|
public void setByte(Object obj,
byte value) throws IllegalArgumentException, IllegalAccessException {
obj = checkSet(VMStack.getCallerClass(0), obj);
VMField.setByte(obj, data.vm_member_id, value);
}
|
public void setChar(Object obj,
char value) throws IllegalArgumentException, IllegalAccessException {
obj = checkSet(VMStack.getCallerClass(0), obj);
VMField.setChar(obj, data.vm_member_id, value);
}
|
public void setDouble(Object obj,
double value) throws IllegalArgumentException, IllegalAccessException {
obj = checkSet(VMStack.getCallerClass(0), obj);
VMField.setDouble(obj, data.vm_member_id, value);
}
|
public void setFloat(Object obj,
float value) throws IllegalArgumentException, IllegalAccessException {
obj = checkSet(VMStack.getCallerClass(0), obj);
VMField.setFloat(obj, data.vm_member_id, value);
}
|
public void setInt(Object obj,
int value) throws IllegalArgumentException, IllegalAccessException {
obj = checkSet(VMStack.getCallerClass(0), obj);
VMField.setInt(obj, data.vm_member_id, value);
}
|
public void setLong(Object obj,
long value) throws IllegalArgumentException, IllegalAccessException {
obj = checkSet(VMStack.getCallerClass(0), obj);
VMField.setLong(obj, data.vm_member_id, value);
}
|
public void setShort(Object obj,
short value) throws IllegalArgumentException, IllegalAccessException {
obj = checkSet(VMStack.getCallerClass(0), obj);
VMField.setShort(obj, data.vm_member_id, value);
}
|
public String toGenericString() {
StringBuilder sb = new StringBuilder(80);
// append modifiers if any
int modifier = getModifiers();
if (modifier != 0) {
sb.append(Modifier.toString(modifier)).append(' ');
}
// append generic type
appendGenericType(sb, getGenericType());
sb.append(' ');
// append full field name
sb.append(getDeclaringClass().getName()).append('.').append(getName());
return sb.toString();
}
|
public String toString() {
StringBuilder sb = new StringBuilder(80);
// append modifiers if any
int modifier = getModifiers();
if (modifier != 0) {
sb.append(Modifier.toString(modifier)).append(' ');
}
// append return type
appendArrayType(sb, getType());
sb.append(' ');
// append full field name
sb.append(getDeclaringClass().getName()).append('.').append(getName());
return sb.toString();
}
|