ua.gradsoft.javachecker.models
Class JavaClassMethodModel

java.lang.Object
  extended by ua.gradsoft.javachecker.models.JavaMethodModel
      extended by ua.gradsoft.javachecker.models.JavaClassMethodModel
All Implemented Interfaces:
AttributedEntity, JavaClassTopLevelBlockOwnerModel, JavaTopLevelBlockOwnerModel

public class JavaClassMethodModel
extends JavaMethodModel
implements JavaClassTopLevelBlockOwnerModel

Model class, which based on reflection mechanizm

Author:
Ruslan Shevchenko

Constructor Summary
JavaClassMethodModel(java.lang.reflect.Method method, JavaClassTypeModel classModel)
          Creates a new instance of JavaClassMethodModel
 
Method Summary
 java.lang.annotation.Annotation getAnnotation(java.lang.Class annotationClass)
          get declared annotations.
 java.util.Map<java.lang.String,JavaAnnotationInstanceModel> getAnnotationsMap()
          get Map of annotation.
 java.lang.reflect.Type[] getClassFormalParameterTypes()
          get set of top-level parameters
 java.lang.reflect.Type[] getClassThrowsTypes()
          get types in exception specification
 JavaClassTypeModel getClassTypeModel()
          get model of type.
 java.lang.reflect.TypeVariable[] getClassTypeParameters()
          get set of top-level parameters
 java.lang.annotation.Annotation[] getDeclaredAnnotations()
          get declared annotations.
 JavaExpressionModel getDefaultValue()
          return default value of method.
 java.util.List<JavaFormalParameterModel> getFormalParametersList()
          get list of formal parameters.
 java.util.Map<java.lang.String,JavaFormalParameterModel> getFormalParametersMap()
          get map of formal parameters.
 java.util.List<JavaTypeModel> getFormalParametersTypes()
          return list of forma-parameters types.
 Term getModelTerm()
          ClassMethod(context)
 JavaTermModifiersModel getModifiers()
           
 java.lang.String getName()
          get name of method.
 java.lang.annotation.Annotation[][] getParameterAnnotations()
          get pointer to parameters annotations.
 JavaTypeModel getResultType()
           
 java.util.List<JavaTypeModel> getThrowsList()
          get List of throwed types in trows specification.
 JavaTopLevelBlockModel getTopLevelBlockModel()
          return block model, if storing of block model is supported, otherwise throws NotSupportedException
 java.util.List<JavaTypeVariableAbstractModel> getTypeParameters()
           
 boolean hasDefaultValue()
          If method has default value
 boolean isSupportBlockModel()
          Class terms does not supports block model, so return false.
 boolean isSynthetic()
          true for synthetic
 boolean isVarArgs()
          true, if this consturctor or method have variable arguments.
 
Methods inherited from class ua.gradsoft.javachecker.models.JavaMethodModel
getAttribute, getChildAttributes, getJavaFacts, getTypeModel, print, printErasedSignature, printSignature, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ua.gradsoft.javachecker.models.JavaTopLevelBlockOwnerModel
getTypeModel, printErasedSignature, printSignature
 
Methods inherited from interface ua.gradsoft.javachecker.attributes.AttributedEntity
getAttribute, getChildAttributes, setAttribute
 

Constructor Detail

JavaClassMethodModel

public JavaClassMethodModel(java.lang.reflect.Method method,
                            JavaClassTypeModel classModel)
Creates a new instance of JavaClassMethodModel

Method Detail

getName

public java.lang.String getName()
Description copied from class: JavaMethodModel
get name of method.

Specified by:
getName in interface JavaTopLevelBlockOwnerModel
Specified by:
getName in class JavaMethodModel
Returns:
method name

getClassTypeModel

public JavaClassTypeModel getClassTypeModel()
Description copied from interface: JavaClassTopLevelBlockOwnerModel
get model of type.

Specified by:
getClassTypeModel in interface JavaClassTopLevelBlockOwnerModel

getModifiers

public JavaTermModifiersModel getModifiers()
Specified by:
getModifiers in class JavaMethodModel

getTypeParameters

public java.util.List<JavaTypeVariableAbstractModel> getTypeParameters()
Specified by:
getTypeParameters in interface JavaTopLevelBlockOwnerModel
Specified by:
getTypeParameters in class JavaMethodModel

getResultType

public JavaTypeModel getResultType()
                            throws TermWareException
Specified by:
getResultType in class JavaMethodModel
Throws:
TermWareException

getFormalParametersTypes

public java.util.List<JavaTypeModel> getFormalParametersTypes()
                                                       throws TermWareException
Description copied from class: JavaMethodModel
return list of forma-parameters types. Note, that type for varargs parameters are arrays.

Specified by:
getFormalParametersTypes in class JavaMethodModel
Throws:
TermWareException

isVarArgs

public boolean isVarArgs()
Description copied from interface: JavaClassTopLevelBlockOwnerModel
true, if this consturctor or method have variable arguments.

Specified by:
isVarArgs in interface JavaClassTopLevelBlockOwnerModel

isSynthetic

public boolean isSynthetic()
Description copied from class: JavaMethodModel
true for synthetic

Specified by:
isSynthetic in class JavaMethodModel

getClassTypeParameters

public java.lang.reflect.TypeVariable[] getClassTypeParameters()
Description copied from interface: JavaClassTopLevelBlockOwnerModel
get set of top-level parameters

Specified by:
getClassTypeParameters in interface JavaClassTopLevelBlockOwnerModel

getClassFormalParameterTypes

public java.lang.reflect.Type[] getClassFormalParameterTypes()
Description copied from interface: JavaClassTopLevelBlockOwnerModel
get set of top-level parameters

Specified by:
getClassFormalParameterTypes in interface JavaClassTopLevelBlockOwnerModel

getClassThrowsTypes

public java.lang.reflect.Type[] getClassThrowsTypes()
Description copied from interface: JavaClassTopLevelBlockOwnerModel
get types in exception specification

Specified by:
getClassThrowsTypes in interface JavaClassTopLevelBlockOwnerModel

getFormalParametersList

public java.util.List<JavaFormalParameterModel> getFormalParametersList()
                                                                 throws TermWareException
Description copied from class: JavaMethodModel
get list of formal parameters.

Specified by:
getFormalParametersList in interface JavaTopLevelBlockOwnerModel
Specified by:
getFormalParametersList in class JavaMethodModel
Throws:
TermWareException

getFormalParametersMap

public java.util.Map<java.lang.String,JavaFormalParameterModel> getFormalParametersMap()
                                                                                throws TermWareException
Description copied from class: JavaMethodModel
get map of formal parameters.

Specified by:
getFormalParametersMap in interface JavaTopLevelBlockOwnerModel
Specified by:
getFormalParametersMap in class JavaMethodModel
Throws:
TermWareException

getThrowsList

public java.util.List<JavaTypeModel> getThrowsList()
                                            throws TermWareException
Description copied from interface: JavaTopLevelBlockOwnerModel
get List of throwed types in trows specification.

Specified by:
getThrowsList in interface JavaTopLevelBlockOwnerModel
Throws:
TermWareException

getAnnotationsMap

public java.util.Map<java.lang.String,JavaAnnotationInstanceModel> getAnnotationsMap()
Description copied from class: JavaMethodModel
get Map of annotation.

Specified by:
getAnnotationsMap in interface JavaTopLevelBlockOwnerModel
Specified by:
getAnnotationsMap in class JavaMethodModel

isSupportBlockModel

public boolean isSupportBlockModel()
Class terms does not supports block model, so return false.

Specified by:
isSupportBlockModel in interface JavaTopLevelBlockOwnerModel
Returns:
false

hasDefaultValue

public boolean hasDefaultValue()
Description copied from class: JavaMethodModel
If method has default value

Specified by:
hasDefaultValue in class JavaMethodModel
Returns:
true if method has default value. (i.,e. this is annotation method).

getDefaultValue

public JavaExpressionModel getDefaultValue()
                                    throws TermWareException
Description copied from class: JavaMethodModel
return default value of method. If method has not default value, return null

Specified by:
getDefaultValue in class JavaMethodModel
Throws:
TermWareException

getModelTerm

public Term getModelTerm()
                  throws TermWareException
ClassMethod(context)

Specified by:
getModelTerm in interface JavaTopLevelBlockOwnerModel
Throws:
TermWareException

getTopLevelBlockModel

public JavaTopLevelBlockModel getTopLevelBlockModel()
Description copied from interface: JavaTopLevelBlockOwnerModel
return block model, if storing of block model is supported, otherwise throws NotSupportedException

Specified by:
getTopLevelBlockModel in interface JavaTopLevelBlockOwnerModel

getDeclaredAnnotations

public java.lang.annotation.Annotation[] getDeclaredAnnotations()
Description copied from interface: JavaClassTopLevelBlockOwnerModel
get declared annotations.

Specified by:
getDeclaredAnnotations in interface JavaClassTopLevelBlockOwnerModel

getAnnotation

public java.lang.annotation.Annotation getAnnotation(java.lang.Class annotationClass)
Description copied from interface: JavaClassTopLevelBlockOwnerModel
get declared annotations.

Specified by:
getAnnotation in interface JavaClassTopLevelBlockOwnerModel

getParameterAnnotations

public java.lang.annotation.Annotation[][] getParameterAnnotations()
Description copied from interface: JavaClassTopLevelBlockOwnerModel
get pointer to parameters annotations.

Specified by:
getParameterAnnotations in interface JavaClassTopLevelBlockOwnerModel