|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.inject.rebind.reflect.MemberLiteral<T,java.lang.reflect.Field>
com.google.gwt.inject.rebind.reflect.FieldLiteral<T>
public class FieldLiteral<T>
Generic field representation preserving the fields type parametrization.
TypeLiteral
Method Summary | ||
---|---|---|
static
|
get(java.lang.reflect.Field field,
TypeLiteral<T> declaringType)
Returns a new field literal based on the passed field and its declaring type. |
|
TypeLiteral<?> |
getFieldType()
Returns the field's type, if appropriate parametrized with the declaring class's type parameters. |
|
boolean |
isLegacyFinalField()
Returns true if this is a final field that past versions of Gin
allowed to be set by member injection. |
|
java.lang.String |
toString()
Returns the field's declaring type and name in the format used in javadoc, e.g. |
Methods inherited from class com.google.gwt.inject.rebind.reflect.MemberLiteral |
---|
getAnnotation, getAnnotations, getBindingAnnotation, getBindingAnnotation, getDeclaringType, getMember, getModifiers, getName, getRawDeclaringType, isAnnotationPresent, isDefaultAccess, isPrivate, isPublic, isStatic |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static <T> FieldLiteral<T> get(java.lang.reflect.Field field, TypeLiteral<T> declaringType)
field
- field for which the literal is createddeclaringType
- the field's declaring type
public TypeLiteral<?> getFieldType()
public boolean isLegacyFinalField()
true
if this is a final field that past versions of Gin
allowed to be set by member injection.
Past versions of Gin used native Javascript to set the values of inaccessible fields. If those fields also happened to be final, the native code would ignore the final modifier and assign the field anyway.
As I (dburrows) don't feel that this is something to encourage, I'm narrowly allowing this usage only in cases where to do otherwise would break previously compiling code. It might be prudent to remove this exclusion in the future, but not as part of my current work.
public java.lang.String toString()
com.bar.Foo#baz
, with resolved type parameters.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |