ua.gradsoft.javachecker.models
Class JavaTermClassOrInterfaceModel

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

public class JavaTermClassOrInterfaceModel
extends JavaTermTypeAbstractModel

Model for Java Type ( Class or Interface )

Author:
Ruslan Shevchenko

Field Summary
static int CLASS_OR_INTERFACE_BODY_INDEX
           
static int CLASS_OR_INTERFACE_TERM_INDEX
           
static int EXTENDS_TERM_INDEX
           
static int IMPLEMENTS_TERM_INDEX
           
static int NAME_IDENTIFIER_TERM_INDEX
           
static int TYPE_PARAMETERS_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
JavaTermClassOrInterfaceModel(Term modifiers, Term t, JavaPackageModel packageModel, JavaUnitModel cuModel)
          Creates a new instance of JavaClassModel
 
Method Summary
 JavaAnnotationInstanceModel getDefaultAnnotationInstanceModel()
          if this is annotation, get annotation instance model, otherwise return null;
 JavaTermExpressionModel getDefaultInitializerExpression()
           
 java.util.Map<java.lang.String,JavaEnumConstantModel> getEnumConstantModels()
          key of return values are names of enum constants.
 Term getModelTerm()
          ClassOrInterfaceModel(modifiers,"class"|"interface",Identifier,typeParameters,extendsList,ImplementsList,ClassOrInterfaceBody(membersList),context)
 boolean hasTypeParameters()
          true, if this type su[pports TypeParameters.
 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, getASTTerm, getCheckerComment, getConstructorModels, getDisabledChecks, getEnclosedStatement, getEnclosedType, getErasedName, getFullNameAsTerm, getInitializerModels, getLastAnonimousTypeIndex, getLastLocalTypeIndex, getMemberModelsList, getMemberVariableModels, getMethodModels, getModifiersModel, getName, getNestedTypeModels, getReferencedType, getShortNameAsTerm, getSuperClass, getSuperInterfaces, getTerm, getTypeParameters, getTypeParametersModel, hasASTTerm, 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

CLASS_OR_INTERFACE_TERM_INDEX

public static final int CLASS_OR_INTERFACE_TERM_INDEX
See Also:
Constant Field Values

NAME_IDENTIFIER_TERM_INDEX

public static final int NAME_IDENTIFIER_TERM_INDEX
See Also:
Constant Field Values

TYPE_PARAMETERS_TERM_INDEX

public static final int TYPE_PARAMETERS_TERM_INDEX
See Also:
Constant Field Values

EXTENDS_TERM_INDEX

public static final int EXTENDS_TERM_INDEX
See Also:
Constant Field Values

IMPLEMENTS_TERM_INDEX

public static final int IMPLEMENTS_TERM_INDEX
See Also:
Constant Field Values

CLASS_OR_INTERFACE_BODY_INDEX

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

JavaTermClassOrInterfaceModel

public JavaTermClassOrInterfaceModel(Term modifiers,
                                     Term t,
                                     JavaPackageModel packageModel,
                                     JavaUnitModel cuModel)
                              throws TermWareException
Creates a new instance of JavaClassModel

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

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
Returns:
empty map.

isAnnotationType

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

getDefaultAnnotationInstanceModel

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

Specified by:
getDefaultAnnotationInstanceModel in class JavaTypeModel
Returns:
null

hasTypeParameters

public boolean hasTypeParameters()
true, if this type su[pports TypeParameters. (note, that list of typeParameters can be empty)

Specified by:
hasTypeParameters in class JavaTypeModel

getModelTerm

public Term getModelTerm()
                  throws TermWareException,
                         EntityNotFoundException
ClassOrInterfaceModel(modifiers,"class"|"interface",Identifier,typeParameters,extendsList,ImplementsList,ClassOrInterfaceBody(membersList),context)

Specified by:
getModelTerm in class JavaTypeModel
Throws:
TermWareException
EntityNotFoundException

getDefaultInitializerExpression

public JavaTermExpressionModel getDefaultInitializerExpression()
                                                        throws TermWareException
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