ua.gradsoft.javachecker.models
Class JavaArrayTypeModel

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

public class JavaArrayTypeModel
extends JavaTypeModel

Type model for Java array

Author:
Ruslan Shevchenko

Constructor Summary
JavaArrayTypeModel(JavaTypeModel referencedType, JavaExpressionModel lengthInitializer)
          Creates a new instance of JavaArrayTypeModel
 
Method Summary
 java.util.Map<java.lang.String,JavaAnnotationInstanceModel> getAnnotationsMap()
          arrays types are not annotated.
 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;
 JavaTermExpressionModel getDefaultInitializerExpression()
           
 JavaStatementModel getEnclosedStatement()
          if this is local or anonimous class and it is possible to get enclosing statement - return enclosed statement, otherwise - null
 JavaTypeModel getEnclosedType()
          return enclosed class
 java.util.Map<java.lang.String,JavaEnumConstantModel> getEnumConstantModels()
          key of return values are names of enum constants.
 java.lang.String getErasedName()
           
 Term getFullNameAsTerm()
           
 java.util.List<JavaInitializerModel> getInitializerModels()
          get list of initializer models
 java.util.Map<java.lang.String,JavaMemberVariableModel> getMemberVariableModels()
          key of return values are names of member variables.
 java.util.Map<java.lang.String,java.util.List<JavaMethodModel>> getMethodModels()
          key of return values are names of methods.
 Term getModelTerm()
          return TypeModel term.
 JavaTermModifiersModel getModifiersModel()
          get modifiers moder
 java.lang.String getName()
           
 java.util.Map<java.lang.String,JavaTypeModel> getNestedTypeModels()
           
 JavaTypeModel getReferencedType()
          Nullable
 Term getShortNameAsTerm()
           
 JavaTypeModel getSuperClass()
          get superclass.
 java.util.List<JavaTypeModel> getSuperInterfaces()
          get all superinterfaces.
 java.util.List<JavaTypeVariableAbstractModel> getTypeParameters()
          return type parameters.
 boolean hasASTTerm()
          return true, if type model have AST Term
 boolean hasMemberVariableModels()
           
 boolean hasMethodModels()
           
 boolean hasNestedTypeModels()
          when return true, getNestedTypeModels() returns set of nested types.
 boolean hasTypeParameters()
          if this type hase type parameters ?
 boolean isAnnotationType()
           
 boolean isAnonimous()
          true, if this is anonimous type.
 boolean isArray()
           
 boolean isClass()
           
 boolean isEnum()
           
 boolean isInterface()
           
 boolean isLocal()
          true, if this is local type
 boolean isNested()
          return true if this type is nested inside some other type.
 boolean isNull()
           
 boolean isPrimitiveType()
           
 boolean isTypeVariable()
           
 boolean isUnknown()
          return true, if this is unknown typemodel.
 boolean isWildcardBounds()
           
 
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, setUnitModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaArrayTypeModel

public JavaArrayTypeModel(JavaTypeModel referencedType,
                          JavaExpressionModel lengthInitializer)
Creates a new instance of JavaArrayTypeModel

Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class JavaTypeModel

getErasedName

public java.lang.String getErasedName()
Specified by:
getErasedName in class JavaTypeModel

getShortNameAsTerm

public Term getShortNameAsTerm()
                        throws TermWareException
Specified by:
getShortNameAsTerm in class JavaTypeModel
Throws:
TermWareException

getFullNameAsTerm

public Term getFullNameAsTerm()
                       throws TermWareException
Specified by:
getFullNameAsTerm in class JavaTypeModel
Throws:
TermWareException

getModifiersModel

public JavaTermModifiersModel getModifiersModel()
Description copied from class: JavaTypeModel
get modifiers moder

Specified by:
getModifiersModel in class JavaTypeModel
Returns:
Modifiers model

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

isPrimitiveType

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

isArray

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

isWildcardBounds

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

isUnknown

public boolean isUnknown()
Description copied from class: JavaTypeModel
return true, if this is unknown typemodel. (clients of library can create Unknonwn model, when it is not possible to resolve entity, but resolving is not critical in context)

Specified by:
isUnknown in class JavaTypeModel

isNull

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

isTypeVariable

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

getEnclosedType

public JavaTypeModel getEnclosedType()
Description copied from class: JavaTypeModel
return enclosed class

Specified by:
getEnclosedType in class JavaTypeModel

getReferencedType

public JavaTypeModel getReferencedType()
Description copied from class: JavaTypeModel
Nullable

Specified by:
getReferencedType in class JavaTypeModel
Returns:
referenced type.

hasTypeParameters

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

Specified by:
hasTypeParameters in class JavaTypeModel
Throws:
TermWareException

getTypeParameters

public java.util.List<JavaTypeVariableAbstractModel> getTypeParameters()
                                                                throws TermWareException
Description copied from class: JavaTypeModel
return type parameters. (i. e. for class { ... } definitions are ) in case of absence of type paramters return empty list

Specified by:
getTypeParameters in class JavaTypeModel
Throws:
TermWareException

hasMethodModels

public boolean hasMethodModels()
Specified by:
hasMethodModels in class JavaTypeModel
Returns:
true if type has methods.

getMethodModels

public java.util.Map<java.lang.String,java.util.List<JavaMethodModel>> getMethodModels()
Description copied from class: JavaTypeModel
key of return values are names of methods. When type is unappropriative for methods (example - TypeVariable) return empty map

Specified by:
getMethodModels in class JavaTypeModel
Returns:
empty Map

hasMemberVariableModels

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

getMemberVariableModels

public java.util.Map<java.lang.String,JavaMemberVariableModel> getMemberVariableModels()
Description copied from class: JavaTypeModel
key of return values are names of member variables. When type is unappropriative for methods - return empty map

Specified by:
getMemberVariableModels in class JavaTypeModel

getConstructorModels

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

Specified by:
getConstructorModels in class JavaTypeModel

getInitializerModels

public java.util.List<JavaInitializerModel> getInitializerModels()
Description copied from class: JavaTypeModel
get list of initializer models

Specified by:
getInitializerModels 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

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

isNested

public boolean isNested()
Description copied from class: JavaTypeModel
return true if this type is nested inside some other type.

Specified by:
isNested in class JavaTypeModel

hasNestedTypeModels

public boolean hasNestedTypeModels()
Description copied from class: JavaTypeModel
when return true, getNestedTypeModels() returns set of nested types. Otherwise getNestedTypeModels throws NotSupportedException

Specified by:
hasNestedTypeModels in class JavaTypeModel

getNestedTypeModels

public java.util.Map<java.lang.String,JavaTypeModel> getNestedTypeModels()
Specified by:
getNestedTypeModels in class JavaTypeModel
Returns:
set of nested types.

getSuperClass

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

Specified by:
getSuperClass in class JavaTypeModel
Throws:
TermWareException

getSuperInterfaces

public java.util.List<JavaTypeModel> getSuperInterfaces()
Description copied from class: JavaTypeModel
get all superinterfaces. does not supported for primitive types, type arguments, wildcard bounds, arrays.

Specified by:
getSuperInterfaces in class JavaTypeModel
Returns:
all direct superinterfaces.

isLocal

public boolean isLocal()
Description copied from class: JavaTypeModel
true, if this is local type

Specified by:
isLocal in class JavaTypeModel

isAnonimous

public boolean isAnonimous()
Description copied from class: JavaTypeModel
true, if this is anonimous type.

Specified by:
isAnonimous in class JavaTypeModel

getEnclosedStatement

public JavaStatementModel getEnclosedStatement()
Description copied from class: JavaTypeModel
if this is local or anonimous class and it is possible to get enclosing statement - return enclosed statement, otherwise - null

Specified by:
getEnclosedStatement in class JavaTypeModel

hasASTTerm

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

Specified by:
hasASTTerm in class JavaTypeModel

getASTTerm

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

Specified by:
getASTTerm in class JavaTypeModel
Throws:
TermWareException
EntityNotFoundException

getModelTerm

public Term getModelTerm()
                  throws TermWareException,
                         EntityNotFoundException
Description copied from class: JavaTypeModel
return TypeModel term. TypeModel is a term which have next form: TypeModel( Model-of-ASTTree, PlaceContext )

Specified by:
getModelTerm in class JavaTypeModel
Throws:
TermWareException
EntityNotFoundException

getAnnotationsMap

public java.util.Map<java.lang.String,JavaAnnotationInstanceModel> getAnnotationsMap()
arrays types are not annotated.

Specified by:
getAnnotationsMap in class JavaTypeModel