1 |
/* java.lang.reflect.Field - reflection of Java fields |
/* java.lang.reflect.Field - reflection of Java fields |
2 |
Copyright (C) 1998, 2001 Free Software Foundation, Inc. |
Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
38 |
|
|
39 |
package java.lang.reflect; |
package java.lang.reflect; |
40 |
|
|
41 |
|
import gnu.java.lang.reflect.FieldSignatureParser; |
42 |
|
|
43 |
/** |
/** |
44 |
* The Field class represents a member variable of a class. It also allows |
* The Field class represents a member variable of a class. It also allows |
45 |
* dynamic access to a member, via reflection. This works for both |
* dynamic access to a member, via reflection. This works for both |
588 |
*/ |
*/ |
589 |
public native void setDouble(Object o, double value) |
public native void setDouble(Object o, double value) |
590 |
throws IllegalAccessException; |
throws IllegalAccessException; |
591 |
|
|
592 |
|
/** |
593 |
|
* Return the generic type of the field. If the field type is not a generic |
594 |
|
* type, the method returns the same as <code>getType()</code>. |
595 |
|
* |
596 |
|
* @throws GenericSignatureFormatError if the generic signature does |
597 |
|
* not conform to the format specified in the Virtual Machine |
598 |
|
* specification, version 3. |
599 |
|
* @since 1.5 |
600 |
|
*/ |
601 |
|
public Type getGenericType() |
602 |
|
{ |
603 |
|
String signature = getSignature(); |
604 |
|
if (signature == null) |
605 |
|
return getType(); |
606 |
|
FieldSignatureParser p = new FieldSignatureParser(getDeclaringClass(), |
607 |
|
signature); |
608 |
|
return p.getFieldType(); |
609 |
|
} |
610 |
|
|
611 |
|
/** |
612 |
|
* Return the String in the Signature attribute for this field. If there |
613 |
|
* is no Signature attribute, return null. |
614 |
|
*/ |
615 |
|
private native String getSignature(); |
616 |
} |
} |