io.sarl.lang.validation.subvalidators
Class SARLMemberValidator
All Superinterfaces:
org.eclipse.emf.ecore.EValidator, org.eclipse.xtext.validation.ValidationMessageAcceptor
class SARLMemberValidator
extends AbstractSARLSubValidatorWithParentLink
A specialized validator to deal with members in SARL types.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.14
Property Summary
Constructor Summary
Constructor and description
new
Action Summary
Modifier and type Action and description
void checkAbstract(XtendFunction)
Check for abstract methods.
void checkActionFires(SarlAction)
Check the types of the parameters of the "fires" statement.
void checkBehaviourUnitEventTypeConformance(SarlBehaviorUnit)
void checkCapacityTypeForUses(SarlCapacityUses)
Check the type of the capacity uses.
void checkCreateFunctionIsNotGeneric(XtendFunction)
void checkCreateFunctionIsNotStatic(XtendFunction)
void checkCreateFunctionIsNotTypeVoid(XtendFunction)
void checkDefaultSuperConstructor(XtendClass)
Check if the super default constructor is correctly invoked.
void checkDefaultValueFinalFieldReferenceInConstructor(SarlFormalParameter)
Check if the default values have valid references to read-only fields from constructors.
void checkDefaultValuePureExpression(SarlFormalParameter)
Check if the default values have not a reference to a not-pure operation.
void checkDefaultValueRedefinition(SarlFormalParameter)
Check if the default value expression is redefined from an inherited definition.
void checkDefaultValueTypeCompatibleWithParameterType(SarlFormalParameter)
Check if the default values of the formal parameters have a compatible type with the formal parameter.
void checkEarlyExitEventInFires(SarlAction)
Emit a warning when the events after the "fires" keyword are not early-exit events.
void checkFieldsAreCalledSelf(XtendField)
void checkFinalFieldInitialization(SarlAgent)
Check if all the fields are initialized in a SARL agent.
void checkFinalFieldInitialization(SarlBehavior)
Check if all the fields are initialized in a SARL behavior.
void checkFinalFieldInitialization(SarlEvent)
Check if all the fields are initialized in a SARL event.
void checkFinalFieldInitialization(SarlSkill)
Check if all the fields are initialized in a SARL skill.
void checkFinalFieldInitialization(XtendClass)
Check if all the fields are initialized in a class.
void checkFinalFieldInitialization(XtendInterface)
Check if all the fields are initialized in an interface.
void checkImplicitReturn(XtendFunction)
void checkJavaKeywordConflict(XtendConstructor)
void checkJavaKeywordConflict(XtendField)
void checkJavaKeywordConflict(XtendFunction)
void checkLocalUsageOfDeclaredFields(XtendField)
void checkLocalUsageOfDeclaredXtendFunction(XtendFunction)
Check the local usage of the functions.
void checkMultipleCapacityUses(SarlCapacityUses)
Check for multiple capacity use declaration.
void checkNonInitializedFieldsHaveAType(XtendField)
void checkNonRawTypeInferred(XtendField)
void checkNonRawTypeInferred(XtendFunction)
void checkNoReturnsInCreateExtensions(XtendFunction)
void checkParameterNames(XtendFunction)
void checkRequiredCapacityUse(SarlRequiredCapacity)
Emit a warning when the "requires" keyword is used.
void checkStaticConstructorPrototype(XtendConstructor)
Check for a valid prototype of a static constructor.
void checkSuperConstructor(SarlAgent)
Check if the super default constructor is correctly invoked.
void checkSuperConstructor(SarlBehavior)
Check if the super default constructor is correctly invoked.
void checkSuperConstructor(SarlEvent)
Check if the super default constructor is correctly invoked.
void checkSuperConstructor(SarlSkill)
Check if the super default constructor is correctly invoked.
protected void checkSuperConstructor(XtendTypeDeclaration,EStructuralFeature,Collection<E>)
Check the super constructors.
void checkTypeParameterForwardReferences(XtendFunction)
Check the type parameters for a function.
void checkTypeParametersAreUnsupported(XtendConstructor)
void checkUnusedCapacities(SarlCapacityUses)
Check for unused capacities.
void checkValidExtension(XtendField)
void checkValidExtension(XtendFormalParameter)
void checkValidExtension(XtendParameter)
void checkValidExtension(XtendVariableDeclaration)
protected void checkValidExtensionType(JvmIdentifiableElement,EObject,EStructuralFeature)
void checkVarArgComesLast(XtendParameter)
void checkVarArgIsNotExtension(XtendParameter)
void dispatchFuncWithTypeParams(XtendFunction)
protected boolean isDefaultValuedParameterFunction(XtendFunction)
Replies if the given function has a default value for one of its parameters.
Constructor Details
new
new
Action Details
checkAbstract(XtendFunction)
def checkAbstract(XtendFunction)
Check for abstract methods.

Override the Xtend behavior for:
  • not generating an error when a return type is missed. Indeed, the return type is "void" by default.
  • generating a warning when "abstract" is missed.
checkActionFires(SarlAction)
def checkActionFires(SarlAction)
Check the types of the parameters of the "fires" statement.
Parameters:
action - the signature that contains the "fires" statement.
checkBehaviourUnitEventTypeConformance(SarlBehaviorUnit)
def checkBehaviourUnitEventTypeConformance(SarlBehaviorUnit)
checkCapacityTypeForUses(SarlCapacityUses)
def checkCapacityTypeForUses(SarlCapacityUses)
Check the type of the capacity uses.
Parameters:
uses - the capacity uses.
checkCreateFunctionIsNotGeneric(XtendFunction)
def checkCreateFunctionIsNotGeneric(XtendFunction)
checkCreateFunctionIsNotStatic(XtendFunction)
def checkCreateFunctionIsNotStatic(XtendFunction)
checkCreateFunctionIsNotTypeVoid(XtendFunction)
def checkCreateFunctionIsNotTypeVoid(XtendFunction)
checkDefaultSuperConstructor(XtendClass)
def checkDefaultSuperConstructor(XtendClass)
Check if the super default constructor is correctly invoked.
Parameters:
xtendClass - the Xtend element.
checkDefaultValueFinalFieldReferenceInConstructor(SarlFormalParameter)
def checkDefaultValueFinalFieldReferenceInConstructor(SarlFormalParameter)
Check if the default values have valid references to read-only fields from constructors.
Parameters:
param - the formal parameter to check.
checkDefaultValuePureExpression(SarlFormalParameter)
def checkDefaultValuePureExpression(SarlFormalParameter)
Check if the default values have not a reference to a not-pure operation.
Parameters:
param - the formal parameter to check.
checkDefaultValueRedefinition(SarlFormalParameter)
def checkDefaultValueRedefinition(SarlFormalParameter)
Check if the default value expression is redefined from an inherited definition.
Parameters:
param - the formal parameter to check.
checkDefaultValueTypeCompatibleWithParameterType(SarlFormalParameter)
def checkDefaultValueTypeCompatibleWithParameterType(SarlFormalParameter)
Check if the default values of the formal parameters have a compatible type with the formal parameter.
Parameters:
param - the formal parameter to check.
checkEarlyExitEventInFires(SarlAction)
def checkEarlyExitEventInFires(SarlAction)
Emit a warning when the events after the "fires" keyword are not early-exit events.
Parameters:
action - the action to check.
checkFieldsAreCalledSelf(XtendField)
def checkFieldsAreCalledSelf(XtendField)
checkFinalFieldInitialization(SarlAgent)
def checkFinalFieldInitialization(SarlAgent)
Check if all the fields are initialized in a SARL agent.
Parameters:
agent - the agent.
checkFinalFieldInitialization(SarlBehavior)
def checkFinalFieldInitialization(SarlBehavior)
Check if all the fields are initialized in a SARL behavior.
Parameters:
behavior - the behavior.
checkFinalFieldInitialization(SarlEvent)
def checkFinalFieldInitialization(SarlEvent)
Check if all the fields are initialized in a SARL event.
Parameters:
event - the event.
checkFinalFieldInitialization(SarlSkill)
def checkFinalFieldInitialization(SarlSkill)
Check if all the fields are initialized in a SARL skill.
Parameters:
skill - the skill.
checkFinalFieldInitialization(XtendClass)
def checkFinalFieldInitialization(XtendClass)
Check if all the fields are initialized in a class.
Parameters:
clazz - the class.
checkFinalFieldInitialization(XtendInterface)
def checkFinalFieldInitialization(XtendInterface)
Check if all the fields are initialized in an interface.
Parameters:
oopInterface - the interface.
checkImplicitReturn(XtendFunction)
def checkImplicitReturn(XtendFunction)
checkJavaKeywordConflict(XtendConstructor)
def checkJavaKeywordConflict(XtendConstructor)
checkJavaKeywordConflict(XtendField)
def checkJavaKeywordConflict(XtendField)
checkJavaKeywordConflict(XtendFunction)
def checkJavaKeywordConflict(XtendFunction)
checkLocalUsageOfDeclaredFields(XtendField)
def checkLocalUsageOfDeclaredFields(XtendField)
checkLocalUsageOfDeclaredXtendFunction(XtendFunction)
def checkLocalUsageOfDeclaredXtendFunction(XtendFunction)
Check the local usage of the functions.
Parameters:
function - the function.
checkMultipleCapacityUses(SarlCapacityUses)
def checkMultipleCapacityUses(SarlCapacityUses)
Check for multiple capacity use declaration.
Parameters:
uses - the capacity use declaration.
checkNonInitializedFieldsHaveAType(XtendField)
def checkNonInitializedFieldsHaveAType(XtendField)
checkNonRawTypeInferred(XtendField)
def checkNonRawTypeInferred(XtendField)
checkNonRawTypeInferred(XtendFunction)
def checkNonRawTypeInferred(XtendFunction)
checkNoReturnsInCreateExtensions(XtendFunction)
def checkNoReturnsInCreateExtensions(XtendFunction)
checkParameterNames(XtendFunction)
def checkParameterNames(XtendFunction)
checkRequiredCapacityUse(SarlRequiredCapacity)
def checkRequiredCapacityUse(SarlRequiredCapacity)
Emit a warning when the "requires" keyword is used.
Parameters:
statement - the statement to check.
checkStaticConstructorPrototype(XtendConstructor)
def checkStaticConstructorPrototype(XtendConstructor)
Check for a valid prototype of a static constructor.
Parameters:
constructor - the constructor to analyze.
checkSuperConstructor(SarlAgent)
def checkSuperConstructor(SarlAgent)
Check if the super default constructor is correctly invoked.
Parameters:
agent - the SARL element.
checkSuperConstructor(SarlBehavior)
def checkSuperConstructor(SarlBehavior)
Check if the super default constructor is correctly invoked.
Parameters:
behavior - the SARL element.
checkSuperConstructor(SarlEvent)
def checkSuperConstructor(SarlEvent)
Check if the super default constructor is correctly invoked.
Parameters:
event - the SARL element.
checkSuperConstructor(SarlSkill)
def checkSuperConstructor(SarlSkill)
Check if the super default constructor is correctly invoked.
Parameters:
skill - the SARL element.
checkSuperConstructor(XtendTypeDeclaration,EStructuralFeature,Collection<E>)
protected def checkSuperConstructor(XtendTypeDeclaration,EStructuralFeature,Collection<E>)
Check the super constructors.
Parameters:
container - the container.
feature - the syntactic feature related to the supertypes.
defaultSignatures - the signatures of the default constructors for the given container.
checkTypeParameterForwardReferences(XtendFunction)
def checkTypeParameterForwardReferences(XtendFunction)
Check the type parameters for a function.
Parameters:
xtendFunction - the function to check.
checkTypeParametersAreUnsupported(XtendConstructor)
def checkTypeParametersAreUnsupported(XtendConstructor)
checkUnusedCapacities(SarlCapacityUses)
def checkUnusedCapacities(SarlCapacityUses)
Check for unused capacities.
Parameters:
uses - the capacity use declaration.
checkValidExtension(XtendField)
def checkValidExtension(XtendField)
checkValidExtension(XtendFormalParameter)
def checkValidExtension(XtendFormalParameter)
checkValidExtension(XtendParameter)
def checkValidExtension(XtendParameter)
checkValidExtension(XtendVariableDeclaration)
def checkValidExtension(XtendVariableDeclaration)
checkValidExtensionType(JvmIdentifiableElement,EObject,EStructuralFeature)
protected def checkValidExtensionType(JvmIdentifiableElement,EObject,EStructuralFeature)
checkVarArgComesLast(XtendParameter)
def checkVarArgComesLast(XtendParameter)
checkVarArgIsNotExtension(XtendParameter)
def checkVarArgIsNotExtension(XtendParameter)
dispatchFuncWithTypeParams(XtendFunction)
def dispatchFuncWithTypeParams(XtendFunction)
isDefaultValuedParameterFunction(XtendFunction)
protected def isDefaultValuedParameterFunction(XtendFunction) : boolean
Replies if the given function has a default value for one of its parameters.
Parameters:
function - the function to test.
Returns:
true if one parameter has a default value.