ua.gradsoft.javachecker.models
Class JavaTermAnnotationTypeModel

java.lang.Object
  extended by ua.gradsoft.javachecker.models.JavaTypeModel
      extended by ua.gradsoft.javachecker.models.JavaTermTypeAbstractModel
          extended by ua.gradsoft.javachecker.models.JavaTermAnnotationTypeModel
All Implemented Interfaces:
AttributedEntity

public class JavaTermAnnotationTypeModel
extends JavaTermTypeAbstractModel

Model of annotation type which holds term.

Author:
Ruslan Shevchenko

Field Summary
static int BODY_TERM_INDEX
           
static int NAME_TERM_INDEX
           
 
Fields inherited from class ua.gradsoft.javachecker.models.JavaTermTypeAbstractModel
checkerComment_, constructors_, fieldModels_, initializers_, isAnonimous_, methodModels_, name_, nestedTypes_, parentType_, resolvedSuperClass_, resolvedSuperInterfaces_, statement_, superClassTerm_, superInterfacesTerms_, t_, typeVariables_
 
Constructor Summary
JavaTermAnnotationTypeModel(Term modifiers, Term t, JavaPackageModel packageModel, JavaUnitModel unitModel)
           
 
Method Summary
protected  void addAnnotationMethodDeclaration(Term modifiers, Term typeTerm, Term identifierTerm, Term defaultValueTerm)
           
protected  void addAnnotationTypeDeclaration(Term modifiers, Term t)
           
 Term getASTTerm()
          return AST term, if exoists, otherwise - null
 java.util.List<JavaConstructorModel> getConstructorModels()
          get list of constructor models.
 JavaAnnotationInstanceModel getDefaultAnnotationInstanceModel()
          if this is annotation, get annotation instance model, otherwise return null;
 JavaExpressionModel getDefaultInitializerExpression()
           
 java.util.Map<java.lang.String,JavaEnumConstantModel> getEnumConstantModels()
          key of return values are names of enum constants.
 Term getModelTerm()
          AnnotationTypeDeclarationModel(modifiers,name,[...],context) where AnnotationTypeBodyModel is list,
 JavaTypeModel getSuperClass()
          get superclass.
 java.util.List<JavaTypeModel> getSuperInterfaces()
          return list of interfaces.
 boolean hasASTTerm()
          return true, if type model have AST Term
 boolean hasTypeParameters()
          if this type hase type parameters ?
 boolean isAnnotationType()
           
 boolean isClass()
           
 boolean isEnum()
           
 boolean isInterface()
           
 
Methods inherited from class ua.gradsoft.javachecker.models.JavaTermTypeAbstractModel
addClassOrInterfaceDeclaration, addConstructorDeclaration, addEnumDeclaration, addFieldDeclaration, addInitializer, addMethodDeclaration, addSuperClass, addSuperInterface, addTypeParameter, getAnnotationsMap, getCheckerComment, getDisabledChecks, getEnclosedStatement, getEnclosedType, getErasedName, getFullNameAsTerm, getInitializerModels, getLastAnonimousTypeIndex, getLastLocalTypeIndex, getMemberModelsList, getMemberVariableModels, getMethodModels, getModifiersModel, getName, getNestedTypeModels, getReferencedType, getShortNameAsTerm, getTerm, getTypeParameters, getTypeParametersModel, hasMemberVariableModels, hasMethodModels, hasNestedTypeModels, isAnonimous, isArray, isLocal, isNested, isNull, isPrimitiveType, isTypeVariable, isUnknown, isWildcardBounds, setUnitModel
 
Methods inherited from class ua.gradsoft.javachecker.models.JavaTypeModel
findMemberVariableModel, findMethodModels, findNestedTypeModel, getAnnotation, getAttribute, getAttributes, getAttributesData, getCanonicalName, getChildAttributes, getErasedFullName, getFullName, getJavaFacts, getPackageModel, getUnitModel, hasAnnotation, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_TERM_INDEX

public static final int NAME_TERM_INDEX
See Also:
Constant Field Values

BODY_TERM_INDEX

public static final int BODY_TERM_INDEX
See Also:
Constant Field Values
Constructor Detail

JavaTermAnnotationTypeModel

public JavaTermAnnotationTypeModel(Term modifiers,
                                   Term t,
                                   JavaPackageModel packageModel,
                                   JavaUnitModel unitModel)
                            throws TermWareException
Throws:
TermWareException
Method Detail

isClass

public boolean isClass()
Specified by:
isClass in class JavaTypeModel

isInterface

public boolean isInterface()
Specified by:
isInterface in class JavaTypeModel

isEnum

public boolean isEnum()
Specified by:
isEnum in class JavaTypeModel

isAnnotationType

public boolean isAnnotationType()
Specified by:
isAnnotationType in class JavaTypeModel

getSuperClass

public JavaTypeModel getSuperClass()
                            throws TermWareException
Description copied from class: JavaTypeModel
get superclass. does not supported for primitive types, type arguments, wildcard bounds

Overrides:
getSuperClass in class JavaTermTypeAbstractModel
Throws:
TermWareException

getSuperInterfaces

public java.util.List<JavaTypeModel> getSuperInterfaces()
                                                 throws TermWareException
Description copied from class: JavaTermTypeAbstractModel
return list of interfaces.

Overrides:
getSuperInterfaces in class JavaTermTypeAbstractModel
Returns:
all direct superinterfaces.
Throws:
TermWareException

getEnumConstantModels

public java.util.Map<java.lang.String,JavaEnumConstantModel> getEnumConstantModels()
Description copied from class: JavaTypeModel
key of return values are names of enum constants. When type is not enum - return empty map.

Specified by:
getEnumConstantModels in class JavaTypeModel

getDefaultAnnotationInstanceModel

public JavaAnnotationInstanceModel getDefaultAnnotationInstanceModel()
                                                              throws TermWareException,
                                                                     EntityNotFoundException
Description copied from class: JavaTypeModel
if this is annotation, get annotation instance model, otherwise return null;

Specified by:
getDefaultAnnotationInstanceModel in class JavaTypeModel
Throws:
TermWareException
EntityNotFoundException

getConstructorModels

public java.util.List<JavaConstructorModel> getConstructorModels()
Description copied from class: JavaTypeModel
get list of constructor models.

Overrides:
getConstructorModels in class JavaTermTypeAbstractModel

hasASTTerm

public boolean hasASTTerm()
Description copied from class: JavaTypeModel
return true, if type model have AST Term

Overrides:
hasASTTerm in class JavaTermTypeAbstractModel

getASTTerm

public Term getASTTerm()
Description copied from class: JavaTypeModel
return AST term, if exoists, otherwise - null

Overrides:
getASTTerm in class JavaTermTypeAbstractModel

getModelTerm

public Term getModelTerm()
                  throws TermWareException,
                         EntityNotFoundException
AnnotationTypeDeclarationModel(modifiers,name,[...],context) where AnnotationTypeBodyModel is list,

Specified by:
getModelTerm in class JavaTypeModel
Throws:
TermWareException
EntityNotFoundException

hasTypeParameters

public boolean hasTypeParameters()
Description copied from class: JavaTypeModel
if this type hase type parameters ?

Specified by:
hasTypeParameters in class JavaTypeModel

getDefaultInitializerExpression

public JavaExpressionModel getDefaultInitializerExpression()
                                                    throws TermWareException,
                                                           EntityNotFoundException
Specified by:
getDefaultInitializerExpression in class JavaTypeModel
Returns:
default initializer erxpression, if entity is not initialized. (i.e. null for complex types, and so on)
Throws:
TermWareException
EntityNotFoundException

addAnnotationTypeDeclaration

protected void addAnnotationTypeDeclaration(Term modifiers,
                                            Term t)
                                     throws TermWareException
Throws:
TermWareException

addAnnotationMethodDeclaration

protected void addAnnotationMethodDeclaration(Term modifiers,
                                              Term typeTerm,
                                              Term identifierTerm,
                                              Term defaultValueTerm)
                                       throws TermWareException
Throws:
TermWareException