ua.gradsoft.javachecker.models
Class JavaTermMethodModel

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

public class JavaTermMethodModel
extends JavaMethodModel
implements JavaTermTopLevelBlockOwnerModel

Model for java method TODO: build block model

Author:
Ruslan Shevchenko

Field Summary
static int BLOCK_INDEX
           
static int METHOD_DECLARATOR__FORMAL_PARAMETERS_INDEX
           
static int METHOD_DECLARATOR__IDENTIFIER_INDEX
           
static int METHOD_DECLARATOR_INDEX
           
static int RESULT_TYPE_TERM_INDEX
           
static int THROWS_SPECIFICATION_INDEX
           
static int TYPE_PARAMETERS_TERM_INDEX
           
 
Constructor Summary
JavaTermMethodModel(Term modifiers, Term t, JavaTermTypeAbstractModel owner)
          Creates a new instance of JavaMethodModel
 
Method Summary
 java.util.Map<java.lang.String,JavaAnnotationInstanceModel> getAnnotationsMap()
          get Map of annotation.
 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.
 Term getFormalParametersTerm()
           
 java.util.List<JavaTypeModel> getFormalParametersTypes()
          return list of forma-parameters types.
 Term getMethodBody()
           
 Term getModelTerm()
          MethodModel(modifiers,typeParameters,ResultType,name,formalParameters,throws,block,context)
 JavaTermModifiersModel getModifiers()
           
 java.lang.String getName()
          get name of method.
 JavaTypeModel getResultType()
           
 Term getResultTypeAsTerm()
           
 Term getTerm()
           
 JavaTermTypeAbstractModel getTermTypeAbstractModel()
          get model of type.
 java.util.List<JavaTypeModel> getThrowsList()
          get List of throwed types in trows specification.
 JavaTopLevelBlockModel getTopLevelBlockModel()
          return top-level block of method or null if one is not defined.
 java.util.List<JavaTypeVariableAbstractModel> getTypeParameters()
           
 boolean hasDefaultValue()
          If method has default value
 boolean isSupportBlockModel()
          return true if storing of block model is supported, otherwise false.
 boolean isSynthetic()
          true for synthetic
 
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
 

Field Detail

TYPE_PARAMETERS_TERM_INDEX

public static final int TYPE_PARAMETERS_TERM_INDEX
See Also:
Constant Field Values

RESULT_TYPE_TERM_INDEX

public static final int RESULT_TYPE_TERM_INDEX
See Also:
Constant Field Values

METHOD_DECLARATOR_INDEX

public static final int METHOD_DECLARATOR_INDEX
See Also:
Constant Field Values

THROWS_SPECIFICATION_INDEX

public static final int THROWS_SPECIFICATION_INDEX
See Also:
Constant Field Values

BLOCK_INDEX

public static final int BLOCK_INDEX
See Also:
Constant Field Values

METHOD_DECLARATOR__IDENTIFIER_INDEX

public static final int METHOD_DECLARATOR__IDENTIFIER_INDEX
See Also:
Constant Field Values

METHOD_DECLARATOR__FORMAL_PARAMETERS_INDEX

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

JavaTermMethodModel

public JavaTermMethodModel(Term modifiers,
                           Term t,
                           JavaTermTypeAbstractModel owner)
                    throws TermWareException
Creates a new instance of JavaMethodModel

Throws:
TermWareException
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

getTerm

public Term getTerm()

getModifiers

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

getResultType

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

getResultTypeAsTerm

public Term getResultTypeAsTerm()
                         throws TermWareException
Throws:
TermWareException

getFormalParametersTerm

public Term getFormalParametersTerm()
                             throws TermWareException
Throws:
TermWareException

getFormalParametersList

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

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

getFormalParametersMap

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

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

getFormalParametersTypes

public java.util.List<JavaTypeModel> getFormalParametersTypes()
                                                       throws TermWareException,
                                                              EntityNotFoundException
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
EntityNotFoundException

getTypeParameters

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

getThrowsList

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

Specified by:
getThrowsList in interface JavaTopLevelBlockOwnerModel
Throws:
TermWareException
EntityNotFoundException

getMethodBody

public Term getMethodBody()
                   throws TermWareException
Throws:
TermWareException

getTermTypeAbstractModel

public JavaTermTypeAbstractModel getTermTypeAbstractModel()
Description copied from interface: JavaTermTopLevelBlockOwnerModel
get model of type.

Specified by:
getTermTypeAbstractModel in interface JavaTermTopLevelBlockOwnerModel

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

hasDefaultValue

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

Specified by:
hasDefaultValue in class JavaMethodModel
Returns:
false

getDefaultValue

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

Specified by:
getDefaultValue in class JavaMethodModel
Returns:
null

isSynthetic

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

Specified by:
isSynthetic in class JavaMethodModel

isSupportBlockModel

public boolean isSupportBlockModel()
Description copied from interface: JavaTopLevelBlockOwnerModel
return true if storing of block model is supported, otherwise false.

Specified by:
isSupportBlockModel in interface JavaTopLevelBlockOwnerModel

getModelTerm

public Term getModelTerm()
                  throws TermWareException,
                         EntityNotFoundException
MethodModel(modifiers,typeParameters,ResultType,name,formalParameters,throws,block,context)

Specified by:
getModelTerm in interface JavaTopLevelBlockOwnerModel
Throws:
TermWareException
EntityNotFoundException

getTopLevelBlockModel

public JavaTopLevelBlockModel getTopLevelBlockModel()
return top-level block of method or null if one is not defined. (for abstract method)

Specified by:
getTopLevelBlockModel in interface JavaTopLevelBlockOwnerModel