com.google.gwt.inject.rebind.reflect
Class MemberLiteral<T,M extends java.lang.reflect.Member & java.lang.reflect.AnnotatedElement>

java.lang.Object
  extended by com.google.gwt.inject.rebind.reflect.MemberLiteral<T,M>
Direct Known Subclasses:
FieldLiteral, MethodLiteral

public abstract class MemberLiteral<T,M extends java.lang.reflect.Member & java.lang.reflect.AnnotatedElement>
extends java.lang.Object

Generic member representation preserving the member's type parameters.

See Also:
TypeLiteral

Constructor Summary
protected MemberLiteral(M member, TypeLiteral<T> declaringType)
           
 
Method Summary
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> type)
          Returns this member's annotation of the passed type or null if no matching annotation is present.
 java.lang.annotation.Annotation[] getAnnotations()
          Returns this member's annotations.
 java.lang.annotation.Annotation getBindingAnnotation()
          Returns this member's binding annotation or null if no such annotation is present.
protected  java.lang.annotation.Annotation getBindingAnnotation(java.lang.annotation.Annotation[] annotations)
           
 TypeLiteral<T> getDeclaringType()
          Returns the type declaring this member.
protected  M getMember()
           
 int getModifiers()
          Returns this member's modifiers.
 java.lang.String getName()
          Returns this member's name.
 java.lang.Class<?> getRawDeclaringType()
          Returns this member's raw (i.e.
 boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> type)
          Returns true if an annotation of the passed type is present on this member.
 boolean isDefaultAccess()
          Returns true if this member is declared as default access.
 boolean isPrivate()
          Returns true if this member is declared private.
 boolean isPublic()
          Returns true if this member is declared public.
 boolean isStatic()
          Returns true if this member is declared static.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemberLiteral

protected MemberLiteral(M member,
                        TypeLiteral<T> declaringType)
Method Detail

getDeclaringType

public TypeLiteral<T> getDeclaringType()
Returns the type declaring this member.

Returns:
declaring type

getName

public java.lang.String getName()
Returns this member's name.

Returns:
name

getRawDeclaringType

public java.lang.Class<?> getRawDeclaringType()
Returns this member's raw (i.e. non-parametrized) declaring type.

Returns:
raw declaring type

getModifiers

public int getModifiers()
Returns this member's modifiers.

Returns:
modifiers

getAnnotations

public java.lang.annotation.Annotation[] getAnnotations()
Returns this member's annotations.

Returns:
annotations

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> type)
Returns this member's annotation of the passed type or null if no matching annotation is present.

Parameters:
type - annotation type
Returns:
annotation instance or null if no matching annotation exists

isAnnotationPresent

public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> type)
Returns true if an annotation of the passed type is present on this member.

Parameters:
type - annotation type to check for
Returns:
true if the annotation is present

getBindingAnnotation

public java.lang.annotation.Annotation getBindingAnnotation()
Returns this member's binding annotation or null if no such annotation is present.

Returns:
binding annotation or null

isDefaultAccess

public boolean isDefaultAccess()
Returns true if this member is declared as default access.

Returns:
true if default access

isPublic

public boolean isPublic()
Returns true if this member is declared public.

Returns:
true if public

isPrivate

public boolean isPrivate()
Returns true if this member is declared private.

Returns:
true if private

isStatic

public boolean isStatic()
Returns true if this member is declared static.

Returns:
true if static

getBindingAnnotation

protected java.lang.annotation.Annotation getBindingAnnotation(java.lang.annotation.Annotation[] annotations)

getMember

protected M getMember()