private class BoundFieldModule.BoundFieldInfo
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) Bind |
bindAnnotation
The
Bind annotation which is present on the field. |
(package private) TypeLiteral<?> |
boundType
The type this field will bind to.
|
(package private) java.lang.reflect.Field |
field
The field itself.
|
(package private) com.google.common.base.Optional<TypeLiteral<?>> |
naturalType
The "natural" type of this field.
|
(package private) TypeLiteral<?> |
type
The actual type of the field.
|
Constructor and Description |
---|
BoundFieldInfo(java.lang.reflect.Field field,
Bind bindAnnotation,
TypeLiteral<?> fieldType) |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
allowsNull()
Returns whether a binding supports null values.
|
private TypeLiteral<?> |
getBoundType() |
private com.google.common.base.Optional<TypeLiteral<?>> |
getNaturalFieldType()
Retrieves the type this field binds to naturally.
|
(package private) java.lang.Object |
getValue() |
final java.lang.reflect.Field field
final TypeLiteral<?> type
For example, @Bind(to = Object.class) Number one = new Integer(1);
will be
Number
.
final TypeLiteral<?> boundType
For example, @Bind(to = Object.class) Number one = new Integer(1);
will be
Object
and @Bind Number one = new Integer(1);
will be Number
.
final com.google.common.base.Optional<TypeLiteral<?>> naturalType
For example, @Bind(to = Object.class) Number one = new Integer(1);
will be
Number
, and @Bind(to = Object.class) Provider<Number> one = new Integer(1);
will be Number
.
getNaturalFieldType()
BoundFieldInfo(java.lang.reflect.Field field, Bind bindAnnotation, TypeLiteral<?> fieldType)
private TypeLiteral<?> getBoundType()
private com.google.common.base.Optional<TypeLiteral<?>> getNaturalFieldType()
A field's "natural" type specifically ignores the to() method on the @Bind annotation, is
the parameterized type if the field's actual type is a parameterized Provider
, is
Optional.absent()
if this field is a non-parameterized Provider
and otherwise
is the field's actual type.
Optional.absent()
if this field is
a non-parameterized Provider
.java.lang.Object getValue()
boolean allowsNull()