ua.gradsoft.javachecker.models
Class JavaMethodModel

java.lang.Object
  extended by ua.gradsoft.javachecker.models.JavaMethodModel
All Implemented Interfaces:
AttributedEntity, JavaTopLevelBlockOwnerModel
Direct Known Subclasses:
JavaClassArgumentBoundMethodModel, JavaClassMethodModel, JavaTermAnnotationMethodModel, JavaTermEnumModel.ValueOfMethodModel, JavaTermEnumModel.ValuesMethodModel, JavaTermMethodModel, JavaTypeArgumentBoundMethodModel

public abstract class JavaMethodModel
extends java.lang.Object
implements JavaTopLevelBlockOwnerModel

Model for method

Author:
Ruslan Shevchenko

Constructor Summary
JavaMethodModel(JavaTypeModel typeModel)
          Creates a new instance of JavaMethodModel
 
Method Summary
abstract  java.util.Map<java.lang.String,JavaAnnotationInstanceModel> getAnnotationsMap()
          get Map of annotation.
 Term getAttribute(java.lang.String name)
           
 AttributedEntity getChildAttributes(java.lang.String childName)
           
abstract  JavaExpressionModel getDefaultValue()
          return default value of method.
abstract  java.util.List<JavaFormalParameterModel> getFormalParametersList()
          get list of formal parameters.
abstract  java.util.Map<java.lang.String,JavaFormalParameterModel> getFormalParametersMap()
          get map of formal parameters.
abstract  java.util.List<JavaTypeModel> getFormalParametersTypes()
          return list of forma-parameters types.
 JavaFacts getJavaFacts()
           
abstract  JavaModifiersModel getModifiers()
           
abstract  java.lang.String getName()
          get name of method.
abstract  JavaTypeModel getResultType()
           
 JavaTypeModel getTypeModel()
           
abstract  java.util.List<JavaTypeVariableAbstractModel> getTypeParameters()
           
abstract  boolean hasDefaultValue()
          If method has default value
abstract  boolean isSynthetic()
          true for synthetic
 void print(java.io.PrintStream out)
           
 void printErasedSignature(java.io.PrintWriter out)
          print signature, where type parameters are erased.
 void printSignature(java.io.PrintWriter out)
          print signature (i.
 void setAttribute(java.lang.String name, Term value)
           
 
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
getModelTerm, getThrowsList, getTopLevelBlockModel, isSupportBlockModel
 

Constructor Detail

JavaMethodModel

public JavaMethodModel(JavaTypeModel typeModel)
Creates a new instance of JavaMethodModel

Method Detail

getName

public abstract java.lang.String getName()
get name of method.

Specified by:
getName in interface JavaTopLevelBlockOwnerModel
Returns:
method name

getModifiers

public abstract JavaModifiersModel getModifiers()

getTypeParameters

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

getResultType

public abstract JavaTypeModel getResultType()
                                     throws TermWareException
Throws:
TermWareException

getFormalParametersTypes

public abstract java.util.List<JavaTypeModel> getFormalParametersTypes()
                                                                throws TermWareException,
                                                                       EntityNotFoundException
return list of forma-parameters types. Note, that type for varargs parameters are arrays.

Throws:
TermWareException
EntityNotFoundException

getFormalParametersList

public abstract java.util.List<JavaFormalParameterModel> getFormalParametersList()
                                                                          throws TermWareException,
                                                                                 EntityNotFoundException
get list of formal parameters.

Specified by:
getFormalParametersList in interface JavaTopLevelBlockOwnerModel
Throws:
TermWareException
EntityNotFoundException

getFormalParametersMap

public abstract java.util.Map<java.lang.String,JavaFormalParameterModel> getFormalParametersMap()
                                                                                         throws TermWareException,
                                                                                                EntityNotFoundException
get map of formal parameters.

Specified by:
getFormalParametersMap in interface JavaTopLevelBlockOwnerModel
Throws:
TermWareException
EntityNotFoundException

getAnnotationsMap

public abstract java.util.Map<java.lang.String,JavaAnnotationInstanceModel> getAnnotationsMap()
                                                                                       throws TermWareException
get Map of annotation.

Specified by:
getAnnotationsMap in interface JavaTopLevelBlockOwnerModel
Throws:
TermWareException

isSynthetic

public abstract boolean isSynthetic()
                             throws TermWareException
true for synthetic

Throws:
TermWareException

printSignature

public void printSignature(java.io.PrintWriter out)
Description copied from interface: JavaTopLevelBlockOwnerModel
print signature (i. e. string, which depends from type parameters, name and formal parameter types) ont pwr.

Specified by:
printSignature in interface JavaTopLevelBlockOwnerModel

printErasedSignature

public void printErasedSignature(java.io.PrintWriter out)
Description copied from interface: JavaTopLevelBlockOwnerModel
print signature, where type parameters are erased.

Specified by:
printErasedSignature in interface JavaTopLevelBlockOwnerModel

print

public void print(java.io.PrintStream out)

getJavaFacts

public JavaFacts getJavaFacts()

getTypeModel

public JavaTypeModel getTypeModel()
Specified by:
getTypeModel in interface JavaTopLevelBlockOwnerModel

hasDefaultValue

public abstract boolean hasDefaultValue()
If method has default value

Returns:
true if method has default value. (i.,e. this is annotation method).

getDefaultValue

public abstract JavaExpressionModel getDefaultValue()
                                             throws TermWareException,
                                                    EntityNotFoundException
return default value of method. If method has not default value, return null

Throws:
TermWareException
EntityNotFoundException

getAttribute

public Term getAttribute(java.lang.String name)
                  throws TermWareException
Specified by:
getAttribute in interface AttributedEntity
Throws:
TermWareException

setAttribute

public void setAttribute(java.lang.String name,
                         Term value)
                  throws TermWareException
Specified by:
setAttribute in interface AttributedEntity
Throws:
TermWareException

getChildAttributes

public AttributedEntity getChildAttributes(java.lang.String childName)
                                    throws TermWareException
Specified by:
getChildAttributes in interface AttributedEntity
Throws:
TermWareException