ua.gradsoft.javachecker.models
Class JavaTypeVariableAbstractModel

java.lang.Object
  extended by ua.gradsoft.javachecker.models.JavaTypeModel
      extended by ua.gradsoft.javachecker.models.JavaTypeVariableAbstractModel
All Implemented Interfaces:
AttributedEntity
Direct Known Subclasses:
JavaClassTypeVariableModel, JavaTermTypeVariableModel, JavaTypeArgumentBoundTypeVariableModel

public abstract class JavaTypeVariableAbstractModel
extends JavaTypeModel

Abstract model for Java Type Variable

Author:
Ruslan Shevchenko

Constructor Summary
JavaTypeVariableAbstractModel()
           
 
Method Summary
 java.util.Map<java.lang.String,JavaAnnotationInstanceModel> getAnnotationsMap()
          get map of annotations, declared in source code.
 Term getASTTerm()
          return AST term, if exoists, otherwise - null
abstract  java.util.List<JavaTypeModel> getBounds()
           
 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.
 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()
          TypeVariableModel(name,bounds) where bounds are lists of typeref
abstract  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()
          return false;
 boolean isAnonimous()
          true, if this is anonimous type.
 boolean isArray()
           
 boolean isClass()
          return false;
 boolean isEnum()
          return false;
 boolean isInterface()
          return false;
 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()
           
 void print(java.io.PrintWriter writer)
           
 java.lang.String toString()
           
 
Methods inherited from class ua.gradsoft.javachecker.models.JavaTypeModel
findMemberVariableModel, findMethodModels, findNestedTypeModel, getAnnotation, getAttribute, getAttributes, getAttributesData, getCanonicalName, getChildAttributes, getErasedFullName, getErasedName, getFullName, getJavaFacts, getModifiersModel, getPackageModel, getUnitModel, hasAnnotation, setAttribute, setUnitModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaTypeVariableAbstractModel

public JavaTypeVariableAbstractModel()
Method Detail

getName

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

getBounds

public abstract java.util.List<JavaTypeModel> getBounds()
                                                 throws TermWareException
Throws:
TermWareException

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

isClass

public boolean isClass()
return false;

Specified by:
isClass in class JavaTypeModel

isInterface

public boolean isInterface()
return false;

Specified by:
isInterface in class JavaTypeModel

isEnum

public boolean isEnum()
return false;

Specified by:
isEnum in class JavaTypeModel

isAnnotationType

public boolean isAnnotationType()
return false;

Specified by:
isAnnotationType in class JavaTypeModel

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

isPrimitiveType

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

isArray

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

isTypeVariable

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

isWildcardBounds

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

isNull

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

getEnclosedType

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

Specified by:
getEnclosedType in class JavaTypeModel
Returns:
null;

getReferencedType

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

Specified by:
getReferencedType in class JavaTypeModel
Returns:
null

getSuperClass

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

Specified by:
getSuperClass in class JavaTypeModel

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.

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

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

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

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

getNestedTypeModels

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

hasTypeParameters

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

Specified by:
hasTypeParameters in class JavaTypeModel
Returns:
false

getTypeParameters

public java.util.List<JavaTypeVariableAbstractModel> getTypeParameters()
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
Returns:
empty list

getAnnotationsMap

public java.util.Map<java.lang.String,JavaAnnotationInstanceModel> getAnnotationsMap()
Description copied from class: JavaTypeModel
get map of annotations, declared in source code.

Specified by:
getAnnotationsMap in class JavaTypeModel
Returns:
empty map

getConstructorModels

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

Specified by:
getConstructorModels in class JavaTypeModel
Returns:
empty list

getInitializerModels

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

Specified by:
getInitializerModels in class JavaTypeModel
Returns:
empty list

print

public void print(java.io.PrintWriter writer)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getModelTerm

public Term getModelTerm()
                  throws TermWareException,
                         EntityNotFoundException
TypeVariableModel(name,bounds) where bounds are lists of typeref

Specified by:
getModelTerm in class JavaTypeModel
Throws:
TermWareException
EntityNotFoundException

hasASTTerm

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

Specified by:
hasASTTerm in class JavaTypeModel
Returns:
false

getASTTerm

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

Specified by:
getASTTerm in class JavaTypeModel
Returns:
null