org.androidtransfuse.analysis.adapter
Class ASTClassField

Package class diagram package ASTClassField
java.lang.Object
  extended by org.androidtransfuse.analysis.adapter.ASTClassField
All Implemented Interfaces:
ASTBase, ASTField

public class ASTClassField
extends Object
implements ASTField

Class specific AST Field

Author:
John Ericksen

Constructor Summary
ASTClassField(Field field, ASTType astType, ASTAccessModifier modifier, com.google.common.collect.ImmutableCollection<ASTAnnotation> annotations)
           
 
Method Summary
 ASTAccessModifier getAccessModifier()
          Supplies the access modifier for this field
<A extends Annotation>
A
getAnnotation(Class<A> annotation)
          Supplies the given annotation instance from the given annotation class key
 Collection<ASTAnnotation> getAnnotations()
          Supplies the set of annotations
 ASTAnnotation getASTAnnotation(Class annotation)
          Getter for the AST Annotation associated with the given annotation type
 ASTType getASTType()
          Supplies the type of the field represented.
 Object getConstantValue()
          Supplies the constant value for this field (if one exists)

IE: static String value = "constant"

 String getName()
          Supplies the name of the current tree node
 boolean isAnnotated(Class<? extends Annotation> annotation)
          Determines if the current element is annotated with the given annotation class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASTClassField

public ASTClassField(Field field,
                     ASTType astType,
                     ASTAccessModifier modifier,
                     com.google.common.collect.ImmutableCollection<ASTAnnotation> annotations)
Method Detail

getASTType

public ASTType getASTType()
Description copied from interface: ASTField
Supplies the type of the field represented.

Specified by:
getASTType in interface ASTField
Returns:
field type

getName

public String getName()
Description copied from interface: ASTBase
Supplies the name of the current tree node

Specified by:
getName in interface ASTBase
Returns:
name of the current node

isAnnotated

public boolean isAnnotated(Class<? extends Annotation> annotation)
Description copied from interface: ASTBase
Determines if the current element is annotated with the given annotation class

Specified by:
isAnnotated in interface ASTBase
Parameters:
annotation - key
Returns:
annotated conditional

getAnnotation

public <A extends Annotation> A getAnnotation(Class<A> annotation)
Description copied from interface: ASTBase
Supplies the given annotation instance from the given annotation class key

Specified by:
getAnnotation in interface ASTBase
Type Parameters:
A - annotation type
Parameters:
annotation - key
Returns:
annotation instance

getAnnotations

public Collection<ASTAnnotation> getAnnotations()
Description copied from interface: ASTBase
Supplies the set of annotations

Specified by:
getAnnotations in interface ASTBase
Returns:
ast annotation list

getAccessModifier

public ASTAccessModifier getAccessModifier()
Description copied from interface: ASTField
Supplies the access modifier for this field

Specified by:
getAccessModifier in interface ASTField
Returns:
field access modifier

getASTAnnotation

public ASTAnnotation getASTAnnotation(Class annotation)
Description copied from interface: ASTBase
Getter for the AST Annotation associated with the given annotation type

Specified by:
getASTAnnotation in interface ASTBase
Parameters:
annotation - type
Returns:
annotation AST

getConstantValue

public Object getConstantValue()
Description copied from interface: ASTField
Supplies the constant value for this field (if one exists)

IE: static String value = "constant"

Specified by:
getConstantValue in interface ASTField
Returns:
constant field values


Copyright © 2012. All Rights Reserved.