ua.gradsoft.javachecker.models
Class JavaTermAnonimousTypeModel

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

public class JavaTermAnonimousTypeModel
extends JavaTermTypeAbstractModel

Class for anonimous type definitions. (which can be situated inside AllocatorExpressions)

Author:
Ruslan Shevchenko

Field Summary
static int CLASS_OR_INTEFACE_BODY_TERM_INDEX
           
static int CLASS_OR_INTERFACE_TERM_INDEX
           
static int TYPE_ARGUMENTS_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
JavaTermAnonimousTypeModel(JavaTermStatementModel statement, Term t, JavaTypeModel enclosedType)
          create new model of anonimous type, where t is AllocatorExpression with type definition,
 
Method Summary
 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()
          AnonimousClassModel(name_,super, membersList,ctx)
 java.lang.String getName()
           
 JavaTypeModel getSuperClass()
          get superclass.
 java.util.List<JavaTypeModel> getSuperInterfaces()
          return list of interfaces.
 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, getASTTerm, getCheckerComment, getConstructorModels, getDisabledChecks, getEnclosedStatement, getEnclosedType, getErasedName, getFullNameAsTerm, getInitializerModels, getLastAnonimousTypeIndex, getLastLocalTypeIndex, getMemberModelsList, getMemberVariableModels, getMethodModels, getModifiersModel, getNestedTypeModels, getReferencedType, getShortNameAsTerm, 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

TYPE_ARGUMENTS_TERM_INDEX

public static final int TYPE_ARGUMENTS_TERM_INDEX
See Also:
Constant Field Values

CLASS_OR_INTEFACE_BODY_TERM_INDEX

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

JavaTermAnonimousTypeModel

public JavaTermAnonimousTypeModel(JavaTermStatementModel statement,
                                  Term t,
                                  JavaTypeModel enclosedType)
                           throws TermWareException
create new model of anonimous type, where t is AllocatorExpression with type definition,

Throws:
TermWareException
Method Detail

getName

public java.lang.String getName()
Overrides:
getName in class JavaTermTypeAbstractModel

isAnnotationType

public boolean isAnnotationType()
Specified by:
isAnnotationType 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

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

isInterface

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

isClass

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

hasTypeParameters

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

Specified by:
hasTypeParameters in class JavaTypeModel

getSuperClass

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

Overrides:
getSuperClass in class JavaTermTypeAbstractModel
Throws:
TermWareException
EntityNotFoundException

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

getModelTerm

public Term getModelTerm()
                  throws TermWareException,
                         EntityNotFoundException
AnonimousClassModel(name_,super, membersList,ctx)

Specified by:
getModelTerm in class JavaTypeModel
Throws:
TermWareException
EntityNotFoundException

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