Interface SMethod<T>
- 
- All Superinterfaces:
 SElement,SExecutable,SNamedElement
- All Known Implementing Classes:
 SMethodImpl
public interface SMethod<T> extends SExecutable
Represents a behavior method for a givenSAbstractConceptIt has aSMethodIdwhich uniquely identifies the instance ofSMethod. The current contract is that twoSMethodare equal as soon as their ids are equal. The supposed way to call behavior methods is as follows. If it is possible to get SMethod directly (from the generated fields ofBHDescriptor) then one needs to take the method from there and invoke it viainvoke(org.jetbrains.mps.openapi.model.SNode, java.lang.Object...)orinvokeSpecial(org.jetbrains.mps.openapi.model.SNode, java.lang.Object...)or others. If it is not possible then one needs to get method by reflection from theBHDescriptor(via #getMethod). Currently there are handy invocation methods in theBHReflectionfacade. T -- java runtime return type (for compile-time checking)- See Also:
 BHDescriptor
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SMethodIdgetId()SAbstractTypegetReturnType()Tinvoke(SAbstractConcept operand, Object... parameters)invokes the method in the case it is static (trying to resolve the right method on runtime if it is virtual)Tinvoke(SNode operand, Object... parameters)invokes the method (trying to resolve the right method on runtime if it is virtual) essentially invokes the #invoke0 method with the concept of the operandTinvoke0(SAbstractConcept operand, SAbstractConcept concreteConcept, Object... parameters)Tinvoke0(SNode operand, SAbstractConcept concreteConcept, Object... parameters)invokes the virtual method as if applied to the node of the concreteConceptTinvokeSpecial(SAbstractConcept operand, Object... parameters)invokes private method (no dynamic method resolve)TinvokeSpecial(SNode operand, Object... parameters)invokes private method (no dynamic method resolve) generated from the super non-virtual invocations or the super<> invocations TinvokeSuper(SAbstractConcept operand, SAbstractConcept concreteConcept, Object... parameters)invokes virtual method looking for the ancestors of the concept (dynamic method resolve)TinvokeSuper(SNode operand, SAbstractConcept concreteConcept, Object... parameters)invokes virtual method looking for the ancestors of the node's concept (dynamic method resolve)booleanisAbstract()abstract => virtualbooleanisStatic()booleanisVirtual()- 
Methods inherited from interface org.jetbrains.mps.openapi.language.SElement
getLanguage, getSourceNode 
- 
Methods inherited from interface jetbrains.mps.core.aspects.behaviour.api.SExecutable
getConcept, getExceptions, getModifiers, getParameters 
- 
Methods inherited from interface org.jetbrains.mps.openapi.language.SNamedElement
getName 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getId
@NotNull SMethodId getId()
- Returns:
 SMethodIdwhich uniquely identifies the behavior methods within the concept NB: all inherited methods count as well However the id of the virtual method and its overrides is the same (!)
 
- 
getReturnType
@NotNull SAbstractType getReturnType()
- Returns:
 - the return type of the SMethod
 
 
- 
invoke
T invoke(@Nullable SNode operand, Object... parameters)
invokes the method (trying to resolve the right method on runtime if it is virtual) essentially invokes the #invoke0 method with the concept of the operand 
- 
invoke
T invoke(@Nullable SAbstractConcept operand, Object... parameters)
invokes the method in the case it is static (trying to resolve the right method on runtime if it is virtual) 
- 
invoke0
T invoke0(@Nullable SNode operand, @NotNull SAbstractConcept concreteConcept, Object... parameters)
invokes the virtual method as if applied to the node of the concreteConcept 
- 
invoke0
T invoke0(@Nullable SAbstractConcept operand, @NotNull SAbstractConcept concreteConcept, Object... parameters)
 
- 
invokeSpecial
T invokeSpecial(@Nullable SNode operand, Object... parameters)
invokes private method (no dynamic method resolve) generated from the super non-virtual invocations or the super<> invocations  
- 
invokeSpecial
T invokeSpecial(@Nullable SAbstractConcept operand, Object... parameters)
invokes private method (no dynamic method resolve) 
- 
invokeSuper
T invokeSuper(@Nullable SNode operand, @NotNull SAbstractConcept concreteConcept, Object... parameters)
invokes virtual method looking for the ancestors of the node's concept (dynamic method resolve)- Parameters:
 concreteConcept- is the concept from which the #invokeSuper is intended to be executed
 
- 
invokeSuper
T invokeSuper(@Nullable SAbstractConcept operand, @NotNull SAbstractConcept concreteConcept, Object... parameters)
invokes virtual method looking for the ancestors of the concept (dynamic method resolve)- Parameters:
 concreteConcept- is the concept from which the #invokeSuper is intended to be executed
 
- 
isVirtual
boolean isVirtual()
- Returns:
 - true iff the method has a virtual modifier
 - See Also:
 SExecutable.getModifiers()
 
- 
isAbstract
boolean isAbstract()
abstract => virtual- Returns:
 - true iff the method has an abstract modifier
 
 
- 
isStatic
boolean isStatic()
- Returns:
 - true iff the method has a static modifier
 - See Also:
 SExecutable.getModifiers()
 
 - 
 
 -