|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.inject.rebind.util.KeyUtil
public class KeyUtil
Util object that offers Key
retrieval and manipulation methods.
Constructor Summary | |
---|---|
KeyUtil(com.google.gwt.core.ext.typeinfo.TypeOracle typeOracle,
MemberCollector memberCollector)
|
Method Summary | |
---|---|
com.google.gwt.core.ext.typeinfo.JClassType |
getClassType(Key<?> key)
|
com.google.gwt.core.ext.typeinfo.JClassType |
getClassType(java.lang.reflect.Type type)
Returns the GWT equivalent of the passed java type. |
Key<?> |
getKey(com.google.gwt.core.ext.typeinfo.JField field)
|
Key<?> |
getKey(com.google.gwt.core.ext.typeinfo.JMethod method)
|
Key<?> |
getKey(com.google.gwt.core.ext.typeinfo.JParameter param)
|
Key<?> |
getKey(com.google.gwt.core.ext.typeinfo.JType gwtType,
java.lang.annotation.Annotation... annotations)
Gets the Guice binding key for a given GWT type with optional annotations. |
Key<?> |
getKey(java.lang.reflect.Type type,
java.lang.annotation.Annotation... annotations)
Gets the Guice binding key for a given Java type with optional annotations. |
com.google.gwt.core.ext.typeinfo.JClassType |
getRawClassType(Key<?> key)
|
java.lang.Class<?> |
getRawType(Key<?> key)
|
RequiredKeys |
getRequiredKeys(com.google.gwt.core.ext.typeinfo.JAbstractMethod method)
Collects and returns all keys required to inject the given method. |
RequiredKeys |
getRequiredKeys(com.google.gwt.core.ext.typeinfo.JClassType classType)
Collects and returns all keys required to inject the given class. |
boolean |
isMemberInject(com.google.gwt.core.ext.typeinfo.JMethod method)
|
boolean |
isOptional(com.google.gwt.core.ext.typeinfo.HasAnnotations member)
Returns true if the passed class member has an @ Inject
annotation and the injection is marked as optional (
@Inject(optional=true) ). |
com.google.gwt.core.ext.typeinfo.JConstructor |
javaToGwtConstructor(java.lang.reflect.Constructor<?> javaConstructor,
TypeLiteral<?> declaringType)
Returns a JConstructor that represents the same constructor as the
provided Constructor reflection object. |
com.google.gwt.core.ext.typeinfo.JField |
javaToGwtField(java.lang.reflect.Field javaField)
Returns a JField that represents the same method as the provided
Field reflection object. |
com.google.gwt.core.ext.typeinfo.JMethod |
javaToGwtMethod(java.lang.reflect.Method javaMethod)
Returns a JMethod that represents the same method as the provided
Method reflection object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Inject public KeyUtil(com.google.gwt.core.ext.typeinfo.TypeOracle typeOracle, MemberCollector memberCollector)
Method Detail |
---|
public Key<?> getKey(com.google.gwt.core.ext.typeinfo.JMethod method)
public Key<?> getKey(com.google.gwt.core.ext.typeinfo.JParameter param)
public Key<?> getKey(com.google.gwt.core.ext.typeinfo.JField field)
public boolean isMemberInject(com.google.gwt.core.ext.typeinfo.JMethod method)
public java.lang.Class<?> getRawType(Key<?> key)
public com.google.gwt.core.ext.typeinfo.JClassType getRawClassType(Key<?> key)
public com.google.gwt.core.ext.typeinfo.JClassType getClassType(Key<?> key)
public com.google.gwt.core.ext.typeinfo.JClassType getClassType(java.lang.reflect.Type type)
null
.
type
- java type
null
if it cannot be resolvedpublic Key<?> getKey(com.google.gwt.core.ext.typeinfo.JType gwtType, java.lang.annotation.Annotation... annotations) throws ProvisionException
gwtType
- GWT type to convert in to a keyannotations
- Optional array of Annotation
s. If this contains
one and only one BindingAnnotation
, it will be included in the
key. If it includes more than one, an exception will be thrown.
ProvisionException
- in case of any failurepublic Key<?> getKey(java.lang.reflect.Type type, java.lang.annotation.Annotation... annotations) throws ProvisionException
type
- Java type to convert in to a keyannotations
- Optional array of Annotation
s. If this contains
one and only one BindingAnnotation
, it will be included in the
key. If it includes more than one, an exception will be thrown.
ProvisionException
- in case of any failurepublic com.google.gwt.core.ext.typeinfo.JMethod javaToGwtMethod(java.lang.reflect.Method javaMethod) throws com.google.gwt.core.ext.typeinfo.NotFoundException
JMethod
that represents the same method as the provided
Method
reflection object.
javaMethod
- method as used by reflection
com.google.gwt.core.ext.typeinfo.NotFoundException
- if method cannot be found in sourcepublic com.google.gwt.core.ext.typeinfo.JConstructor javaToGwtConstructor(java.lang.reflect.Constructor<?> javaConstructor, TypeLiteral<?> declaringType) throws com.google.gwt.core.ext.typeinfo.NotFoundException
JConstructor
that represents the same constructor as the
provided Constructor
reflection object.
Note: This is almost the same method as javaToGwtMethod(Method)
but cannot be merged since constructors and methods do not derive from a
common interface in reflection.
javaConstructor
- method as used by reflectiondeclaringType
- type which declares the constructor (with type
parameters)
com.google.gwt.core.ext.typeinfo.NotFoundException
- if constructor cannot be found in sourcepublic com.google.gwt.core.ext.typeinfo.JField javaToGwtField(java.lang.reflect.Field javaField)
JField
that represents the same method as the provided
Field
reflection object.
javaField
- field as used by reflection
public boolean isOptional(com.google.gwt.core.ext.typeinfo.HasAnnotations member)
Inject
annotation and the injection is marked as optional (
@Inject(optional=true)
).
Note that Inject
does not have an optional parameter
and therefore cannot be optional.
member
- member to be checked
public RequiredKeys getRequiredKeys(com.google.gwt.core.ext.typeinfo.JClassType classType)
classType
- class for which required keys are calculated
public RequiredKeys getRequiredKeys(com.google.gwt.core.ext.typeinfo.JAbstractMethod method)
method
- method for which required keys are calculated
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |