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)
Check if the given behavior unit has an event specification that is conform to the event's declaration.
void checkCapacityTypeForUses(SarlCapacityUses)
Check the type of the capacity uses.
void checkCreateFunctionIsNotGeneric(XtendFunction)
Check if a creation function is not of defined with type parameters.
void checkCreateFunctionIsNotStatic(XtendFunction)
Check if there is a creation function is defined as static.
void checkCreateFunctionIsNotTypeVoid(XtendFunction)
Check if a creation function is not of type void.
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)
Check if the field has a name that is not "self".
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)
Check if the function has an implicit return statement.
void checkJavaKeywordConflict(XtendConstructor)
Check if the type parameters of given constructor have names that are not conflicting a keyword of Java.
void checkJavaKeywordConflict(XtendField)
Check if the given field has a name that is not conflicting a keyword of Java.
void checkJavaKeywordConflict(XtendFunction)
Check if the given function and its type parameters have names that are not conflicting a keyword of Java.
void checkJavaMainFunction(SarlAction)
Check the definition of a Java main function.
void checkLocalUsageOfDeclaredFields(XtendField)
Check the usage of local fields.
void checkLocalUsageOfDeclaredXtendFunction(XtendFunction)
Check the local usage of the functions.
void checkMultipleCapacityUses(SarlCapacityUses)
Check for multiple capacity use declaration.
void checkNonInitializedFieldsHaveAType(XtendField)
Check if the field is initialized or has a declared type.
void checkNonRawTypeInferred(XtendField)
Check if the given field has an inferred type that is not raw.
void checkNonRawTypeInferred(XtendFunction)
Check if the given function has an inferred return type that is not raw.
void checkNoReturnsInCreateExtensions(XtendFunction)
Check if there is no return statement in a creation extension.
void checkParameterNames(XtendFunction)
Check if the parameters' names are valid.
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)
Check that the given constructor has no type parameter declared.
void checkUnusedCapacities(SarlCapacityUses)
Check for unused capacities.
void checkValidExtension(XtendField)
Check if the given field has a valid type for extension mechanism.
void checkValidExtension(XtendFormalParameter)
Check if the given formal parameter has a valid type for extension mechanism.
void checkValidExtension(XtendParameter)
Check if the given parameter has a valid type for extension mechanism.
void checkValidExtension(XtendVariableDeclaration)
Check if the given variable has a valid type for extension mechanism.
protected void checkValidExtensionType(JvmIdentifiableElement,EObject,EStructuralFeature)
void checkVarArgComesLast(XtendParameter)
Check if the variadic parameter is the last parameter of the enclosing function.
void checkVarArgIsNotExtension(XtendParameter)
Check if the parameter is not marked as extension and variadic at the same time.
void dispatchFuncWithTypeParams(XtendFunction)
Check if the given dispatch function has a valid set of formal parameters and type parameters and has a valid function name.
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.
Parameters:
function - the function to check.
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)
Check if the given behavior unit has an event specification that is conform to the event's declaration.
Parameters:
unit - the event handler to check.
checkCapacityTypeForUses(SarlCapacityUses)
def checkCapacityTypeForUses(SarlCapacityUses)
Check the type of the capacity uses.
Parameters:
uses - the capacity uses.
checkCreateFunctionIsNotGeneric(XtendFunction)
def checkCreateFunctionIsNotGeneric(XtendFunction)
Check if a creation function is not of defined with type parameters.
Parameters:
function - the function to check.
checkCreateFunctionIsNotStatic(XtendFunction)
def checkCreateFunctionIsNotStatic(XtendFunction)
Check if there is a creation function is defined as static.
Parameters:
function - the function to check.
checkCreateFunctionIsNotTypeVoid(XtendFunction)
def checkCreateFunctionIsNotTypeVoid(XtendFunction)
Check if a creation function is not of type void.
Parameters:
function - the function to check.
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)
Check if the field has a name that is not "self".
Parameters:
field - the field to check.
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)
Check if the function has an implicit return statement.
Parameters:
function - the function to check.
checkJavaKeywordConflict(XtendConstructor)
def checkJavaKeywordConflict(XtendConstructor)
Check if the type parameters of given constructor have names that are not conflicting a keyword of Java.
Parameters:
constructor - the constructor to check.
checkJavaKeywordConflict(XtendField)
def checkJavaKeywordConflict(XtendField)
Check if the given field has a name that is not conflicting a keyword of Java.
Parameters:
field - the field to check.
checkJavaKeywordConflict(XtendFunction)
def checkJavaKeywordConflict(XtendFunction)
Check if the given function and its type parameters have names that are not conflicting a keyword of Java.
Parameters:
function - the function to check.
checkJavaMainFunction(SarlAction)
def checkJavaMainFunction(SarlAction)
Check the definition of a Java main function.
Parameters:
function - the function to test.
checkLocalUsageOfDeclaredFields(XtendField)
def checkLocalUsageOfDeclaredFields(XtendField)
Check the usage of local fields.
Parameters:
field - the field to check.
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)
Check if the field is initialized or has a declared type.
Parameters:
field - the field to check.
checkNonRawTypeInferred(XtendField)
def checkNonRawTypeInferred(XtendField)
Check if the given field has an inferred type that is not raw.
Parameters:
field - the field to check.
checkNonRawTypeInferred(XtendFunction)
def checkNonRawTypeInferred(XtendFunction)
Check if the given function has an inferred return type that is not raw.
Parameters:
function - the function to check.
checkNoReturnsInCreateExtensions(XtendFunction)
def checkNoReturnsInCreateExtensions(XtendFunction)
Check if there is no return statement in a creation extension.
Parameters:
function - the function to check.
checkParameterNames(XtendFunction)
def checkParameterNames(XtendFunction)
Check if the parameters' names are valid.
Parameters:
function - the function for which the parameters' names must be checked.
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)
Check that the given constructor has no type parameter declared.
Parameters:
constructor - the constructor to check.
checkUnusedCapacities(SarlCapacityUses)
def checkUnusedCapacities(SarlCapacityUses)
Check for unused capacities.
Parameters:
uses - the capacity use declaration.
checkValidExtension(XtendField)
def checkValidExtension(XtendField)
Check if the given field has a valid type for extension mechanism.
Parameters:
field - the field to check.
checkValidExtension(XtendFormalParameter)
def checkValidExtension(XtendFormalParameter)
Check if the given formal parameter has a valid type for extension mechanism.
Parameters:
parameter - the parameter to check.
checkValidExtension(XtendParameter)
def checkValidExtension(XtendParameter)
Check if the given parameter has a valid type for extension mechanism.
Parameters:
parameter - the parameter to check.
checkValidExtension(XtendVariableDeclaration)
def checkValidExtension(XtendVariableDeclaration)
Check if the given variable has a valid type for extension mechanism.
Parameters:
variableDeclaration - the variable to check.
checkValidExtensionType(JvmIdentifiableElement,EObject,EStructuralFeature)
protected def checkValidExtensionType(JvmIdentifiableElement,EObject,EStructuralFeature)
checkVarArgComesLast(XtendParameter)
def checkVarArgComesLast(XtendParameter)
Check if the variadic parameter is the last parameter of the enclosing function.
Parameters:
param - the parameter to check.
checkVarArgIsNotExtension(XtendParameter)
def checkVarArgIsNotExtension(XtendParameter)
Check if the parameter is not marked as extension and variadic at the same time.
Parameters:
param - the parameter to check.
dispatchFuncWithTypeParams(XtendFunction)
def dispatchFuncWithTypeParams(XtendFunction)
Check if the given dispatch function has a valid set of formal parameters and type parameters and has a valid function name.
Parameters:
function - the dispatch function to check.
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.