io.sarl.lang.validation.subvalidators
Class AbstractSARLSubValidator
All Superinterfaces:
org.eclipse.emf.ecore.EValidator, org.eclipse.xtext.validation.ValidationMessageAcceptor
All Known Subclasses:
AbstractSARLSubValidatorWithParentLink, SARLBehaviorUnitValidator, SARLDocumentationValidator, SARLFeatureCallsValidator, SARLFeatureModifierValidator, SARLNamingValidator, SARLSynchronizationValidator
abstract class AbstractSARLSubValidator
extends java.lang.Object
A abstract implementation of AbstractDeclarativeValidator that provides utility functions.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.14
Property Summary
Modifier and type Property and description
protected SarlJvmModelAssociations associations
Replies the associations between SARL and JVM models.
protected org.eclipse.xtext.xbase.util.XExpressionHelper expressionHelper
Replies the expression helper.
protected org.eclipse.xtext.xbase.validation.FeatureNameValidator featureNameValidator
Replies the validator of feture names.
protected SARLGrammarKeywordAccess grammarAccess
Replies the accessor to the grammar.
protected IImmutableTypeValidator immutableTypeValidator
Replies the validator for immutable types.
protected InheritanceHelper inheritanceHelper
Replies the tools for checking the inheritance of types.
protected org.eclipse.xtext.xbase.jvmmodel.ILogicalContainerProvider logicalContainerProvider
Replies the logical container provider.
protected SARLOperationHelper operationHelper
Replies the tools for managing operations.
protected SARLReadAndWriteTracking readAndWriteTracking
Replies the read-write tracker.
protected IActionPrototypeProvider sarlActionSignatures
Replies the tools for managing the SARL action signatures.
protected org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices services
Replies the type computation services.
protected org.eclipse.xtext.common.types.util.TypeReferences typeReferences
Replies the tools for using type references.
protected java.util.List<E> visibilityModifiers
Replies all the visibility modifiers.
Constructor Summary
Constructor and description
new
Action Summary
Modifier and type Action and description
protected java.lang.String canonicalName(EObject)
Replies the canonical name of the given object.
protected static java.lang.String canonicalName(LightweightTypeReference)
Replies the canonical name for the given type.
protected void checkNoJavaKeyword(EObject,EAttribute)
Check if the attribute for the given object is not a Java keyword.
protected boolean doCheckValidMemberName(XtendMember)
Replies if the given member has a valid EMF name.
protected org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference getActualType(JvmIdentifiableElement)
Replies the type of the given identifiable element.
protected org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference getActualType(XExpression)
Replies the type of the given expression.
protected org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference getActualType(EObject,JvmIdentifiableElement)
Replies the type of the given element.
protected java.util.Iterator<E> getAllFeatureCalls(XExpression)
Replies all the feature calls in the given expression.
protected SarlJvmModelAssociations getAssociations
Replies the associations between SARL and JVM models.
protected java.lang.String getDeclaratorName(JvmFeature)
Replies the name of declarator for the given member.
protected org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference getExpectedType(XExpression)
Replies the expected type of the given expression.
protected org.eclipse.xtext.xbase.util.XExpressionHelper getExpressionHelper
Replies the expression helper.
protected org.eclipse.xtext.xbase.validation.FeatureNameValidator getFeatureNameValidator
Replies the validator of feture names.
protected SARLGrammarKeywordAccess getGrammarAccess
Replies the accessor to the grammar.
protected IImmutableTypeValidator getImmutableTypeValidator
Replies the validator for immutable types.
protected InheritanceHelper getInheritanceHelper
Replies the tools for checking the inheritance of types.
org.eclipse.xtext.validation.IssueSeverities getIssueSeverities(Map<K,V>,EObject)
protected org.eclipse.xtext.xbase.jvmmodel.ILogicalContainerProvider getLogicalContainerProvider
Replies the logical container provider.
protected java.lang.String getNameOfTypes(LightweightTypeReference)
Replies the name for the give type.
protected SARLOperationHelper getOperationHelper
Replies the tools for managing operations.
protected final org.eclipse.emf.ecore.EObject getOutermostType(XtendMember)
Replies the outer-most type of the given member.
protected java.util.List<E> getParamTypeReferences(JvmExecutable,boolean,boolean)
Retrieve the types of the formal parameters of the given JVM executable object.
protected SARLReadAndWriteTracking getReadAndWriteTracking
Replies the read-write tracker.
protected static org.eclipse.xtext.xbase.XMemberFeatureCall getRootOfMemberFeatureCallSequence(EObject,EObject,Procedure1<Param>)
Replies the member feature call that is the root of a sequence of member feature calls.
protected IActionPrototypeProvider getSarlActionSignatures
Replies the tools for managing the SARL action signatures.
protected org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices getServices
Replies the type computation services.
protected org.eclipse.xtext.common.types.util.TypeReferences getTypeReferences
Replies the tools for using type references.
protected java.util.List<E> getVisibilityModifiers
Replies all the visibility modifiers.
protected boolean isAOConstructorContainer(XtendTypeDeclaration)
Replies if the given type is an agent-oriented type that could receives a constructor declaration.
protected boolean isAOContainer(XtendTypeDeclaration)
Replies if the given type is an agent-oriented container type.
protected boolean isIgnored(String,EObject)
Replies if the given issue is ignored for the given object.
protected boolean isImmutable(EObject)
Replies if the given element is an immutable element.
protected boolean isLocallyAssigned(EObject,EObject)
Replies if the given object is locally assigned.
protected boolean isReallyDisallowedName(QualifiedName)
This functions checks of the given name is disallowed.
protected boolean isTypeFreeExpression(XExpression)
Replies if the given expression has no specific type.
protected java.lang.String memberName(XtendField)
Replies the label for the given field.
protected java.lang.String memberName(XtendFunction)
Replies the label for the given function.
void register(EValidatorRegistrar)
protected org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference toLightweightTypeReference(JvmTypeReference)
Replies the lightweight type reference that is corresponding to the given type reference.
protected org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference toLightweightTypeReference(JvmTypeReference,boolean)
Replies the lightweight type reference that is corresponding to the given type reference.
protected java.lang.String typeName(XtendTypeDeclaration)
Replies the label for the given type that is composed by the type's label and the type's name.
Property Details
associations
protected val associations : SarlJvmModelAssociations
Replies the associations between SARL and JVM models.

This property is an alias for the action: getAssociations

Returns:
the associations.
expressionHelper
protected val expressionHelper : org.eclipse.xtext.xbase.util.XExpressionHelper
Replies the expression helper.

This property is an alias for the action: getExpressionHelper

Returns:
the helper.
featureNameValidator
protected val featureNameValidator : org.eclipse.xtext.xbase.validation.FeatureNameValidator
Replies the validator of feture names.

This property is an alias for the action: getFeatureNameValidator

Returns:
the validator.
grammarAccess
protected val grammarAccess : SARLGrammarKeywordAccess
Replies the accessor to the grammar.

This property is an alias for the action: getGrammarAccess

Returns:
the accessor.
immutableTypeValidator
protected val immutableTypeValidator : IImmutableTypeValidator
Replies the validator for immutable types.

This property is an alias for the action: getImmutableTypeValidator

Returns:
the validator.
inheritanceHelper
protected val inheritanceHelper : InheritanceHelper
Replies the tools for checking the inheritance of types.

This property is an alias for the action: getInheritanceHelper

Returns:
the tool.
logicalContainerProvider
protected val logicalContainerProvider : org.eclipse.xtext.xbase.jvmmodel.ILogicalContainerProvider
Replies the logical container provider.

This property is an alias for the action: getLogicalContainerProvider

Returns:
the tool.
operationHelper
protected val operationHelper : SARLOperationHelper
Replies the tools for managing operations.

This property is an alias for the action: getOperationHelper

Returns:
the tool.
readAndWriteTracking
protected val readAndWriteTracking : SARLReadAndWriteTracking
Replies the read-write tracker.

This property is an alias for the action: getReadAndWriteTracking

Returns:
the tracker.
sarlActionSignatures
protected val sarlActionSignatures : IActionPrototypeProvider
Replies the tools for managing the SARL action signatures.

This property is an alias for the action: getSarlActionSignatures

Returns:
the tool.
services
protected val services : org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices
Replies the type computation services.

This property is an alias for the action: getServices

Returns:
the associations.
typeReferences
protected val typeReferences : org.eclipse.xtext.common.types.util.TypeReferences
Replies the tools for using type references.

This property is an alias for the action: getTypeReferences

Returns:
the tool.
visibilityModifiers
protected val visibilityModifiers : java.util.List<E>
Replies all the visibility modifiers.

This property is an alias for the action: getVisibilityModifiers

Returns:
the visibility modifiers.
Constructor Details
new
new
Action Details
canonicalName(EObject)
protected def canonicalName(EObject) : java.lang.String
Replies the canonical name of the given object.
Parameters:
object - the object.
Returns:
the canonical name or null if it cannot be computed.
canonicalName(LightweightTypeReference)
protected def canonicalName(LightweightTypeReference) : java.lang.String
Replies the canonical name for the given type.
Parameters:
typeRef - the type.
Returns:
the canonical name.
checkNoJavaKeyword(EObject,EAttribute)
protected def checkNoJavaKeyword(EObject,EAttribute)
Check if the attribute for the given object is not a Java keyword.
Parameters:
obj - the object.
attribute - the attribute.
doCheckValidMemberName(XtendMember)
protected def doCheckValidMemberName(XtendMember) : boolean
Replies if the given member has a valid EMF name.
Parameters:
member - the member to text.
Returns:
getActualType(JvmIdentifiableElement)
protected def getActualType(JvmIdentifiableElement) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Replies the type of the given identifiable element.
Parameters:
identifiable - the identifiable element to evaluate.
Returns:
the type of the element.
getActualType(XExpression)
protected def getActualType(XExpression) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Replies the type of the given expression.
Parameters:
expression - the expression to evaluate.
Returns:
the type of the expression.
getActualType(EObject,JvmIdentifiableElement)
protected def getActualType(EObject,JvmIdentifiableElement) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Replies the type of the given element.
Parameters:
context - the type context.
element - the element for which the type is computed.
Returns:
the type of the element.
getAllFeatureCalls(XExpression)
protected def getAllFeatureCalls(XExpression) : java.util.Iterator<E>
Replies all the feature calls in the given expression.
Parameters:
expr - the expression to analyze.
Returns:
the iterator on the feature calls.
getAssociations
protected def getAssociations : SarlJvmModelAssociations
Replies the associations between SARL and JVM models.
Returns:
the associations.
getDeclaratorName(JvmFeature)
protected def getDeclaratorName(JvmFeature) : java.lang.String
Replies the name of declarator for the given member.
Parameters:
feature - the member for which the declarated should be determined.
Returns:
the name of the declarator.
getExpectedType(XExpression)
protected def getExpectedType(XExpression) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Replies the expected type of the given expression.
Parameters:
expression - the expression to evaluate.
Returns:
the expected type of the expressiont.
getExpressionHelper
protected def getExpressionHelper : org.eclipse.xtext.xbase.util.XExpressionHelper
Replies the expression helper.
Returns:
the helper.
getFeatureNameValidator
protected def getFeatureNameValidator : org.eclipse.xtext.xbase.validation.FeatureNameValidator
Replies the validator of feture names.
Returns:
the validator.
getGrammarAccess
protected def getGrammarAccess : SARLGrammarKeywordAccess
Replies the accessor to the grammar.
Returns:
the accessor.
getImmutableTypeValidator
protected def getImmutableTypeValidator : IImmutableTypeValidator
Replies the validator for immutable types.
Returns:
the validator.
getInheritanceHelper
protected def getInheritanceHelper : InheritanceHelper
Replies the tools for checking the inheritance of types.
Returns:
the tool.
getIssueSeverities(Map<K,V>,EObject)
def getIssueSeverities(Map<K,V>,EObject) : org.eclipse.xtext.validation.IssueSeverities
getLogicalContainerProvider
protected def getLogicalContainerProvider : org.eclipse.xtext.xbase.jvmmodel.ILogicalContainerProvider
Replies the logical container provider.
Returns:
the tool.
getNameOfTypes(LightweightTypeReference)
protected def getNameOfTypes(LightweightTypeReference) : java.lang.String
Replies the name for the give type.
Parameters:
expectedType - the type.
Returns:
the name.
getOperationHelper
protected def getOperationHelper : SARLOperationHelper
Replies the tools for managing operations.
Returns:
the tool.
getOutermostType(XtendMember)
protected def getOutermostType(XtendMember) : org.eclipse.emf.ecore.EObject
Replies the outer-most type of the given member.
Returns:
the container of XtendTypeDeclaration type if it exists, or the direct container.
getParamTypeReferences(JvmExecutable,boolean,boolean)
protected def getParamTypeReferences(JvmExecutable,boolean,boolean) : java.util.List<E>
Retrieve the types of the formal parameters of the given JVM executable object.
Parameters:
jvmExecutable - the JVM executable.
wrapFromPrimitives - indicates if the primitive types must be wrapped to object type equivalent.
wrapToPrimitives - indicates if the object types must be wrapped to primitive type equivalent.
Returns:
the list of types.
Since:
0.8
getReadAndWriteTracking
protected def getReadAndWriteTracking : SARLReadAndWriteTracking
Replies the read-write tracker.
Returns:
the tracker.
getRootOfMemberFeatureCallSequence(EObject,EObject,Procedure1<Param>)
protected def getRootOfMemberFeatureCallSequence(EObject,EObject,Procedure1<Param>) : org.eclipse.xtext.xbase.XMemberFeatureCall
Replies the member feature call that is the root of a sequence of member feature calls.

While the current feature call is the actual receiver of a member feature call, and not an argument, the sequence is still active. Otherwise, the sequence is stopped.
Parameters:
leaf - the expression at the leaf of the feature call.
container - the top most container that cannot be part of the sequence. Could be null.
feedback - the function that is invoked on each discovered member feature call within the sequence. Could be null.
Returns:
the root of a member feature call sequence.
getSarlActionSignatures
protected def getSarlActionSignatures : IActionPrototypeProvider
Replies the tools for managing the SARL action signatures.
Returns:
the tool.
getServices
protected def getServices : org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices
Replies the type computation services.
Returns:
the associations.
getTypeReferences
protected def getTypeReferences : org.eclipse.xtext.common.types.util.TypeReferences
Replies the tools for using type references.
Returns:
the tool.
getVisibilityModifiers
protected def getVisibilityModifiers : java.util.List<E>
Replies all the visibility modifiers.
Returns:
the visibility modifiers.
isAOConstructorContainer(XtendTypeDeclaration)
protected def isAOConstructorContainer(XtendTypeDeclaration) : boolean
Replies if the given type is an agent-oriented type that could receives a constructor declaration.
Parameters:
type - is the type to test.
Returns:
true if the given type could contain a constructor declaration.
Since:
0.12
isAOContainer(XtendTypeDeclaration)
protected def isAOContainer(XtendTypeDeclaration) : boolean
Replies if the given type is an agent-oriented container type.
Parameters:
type - is the type to test.
Returns:
true if the given type could contain a AOP declaration.
Since:
0.12
isIgnored(String,EObject)
protected def isIgnored(String,EObject) : boolean
Replies if the given issue is ignored for the given object.
Parameters:
issueCode - the code if the issue.
currentObject - the current object.
Returns:
true if the issue is ignored.
See:
isIgnored(String)
isImmutable(EObject)
protected def isImmutable(EObject) : boolean
Replies if the given element is an immutable element.
Parameters:
element - the element to test.
Returns:
true if the element is immutable.
isLocallyAssigned(EObject,EObject)
protected def isLocallyAssigned(EObject,EObject) : boolean
Replies if the given object is locally assigned.

An object is locally assigned when it is the left operand of an assignment operation.
Parameters:
target - the object to test.
containerToFindUsage - the container in which the usages should be find.
Returns:
true if the given object is assigned.
Since:
0.7
isReallyDisallowedName(QualifiedName)
protected def isReallyDisallowedName(QualifiedName) : boolean
This functions checks of the given name is disallowed. The SARLFeatureNameValidator provides the basic conditions. It is not detecting the implicit lambda's parameter names. This specific function does.
Parameters:
name - the name to test.
Returns:
true if the name is really disallowed.
isTypeFreeExpression(XExpression)
protected def isTypeFreeExpression(XExpression) : boolean
Replies if the given expression has no specific type.
Parameters:
expression - the expression to test
Returns:
true if the given expression cannot have a specific type.
memberName(XtendField)
protected def memberName(XtendField) : java.lang.String
Replies the label for the given field.
Parameters:
field - the field to analyse.
Returns:
the label for the field.
Since:
0.14
memberName(XtendFunction)
protected def memberName(XtendFunction) : java.lang.String
Replies the label for the given function.
Parameters:
function - the type to function.
Returns:
the label for the field.
Since:
0.14
register(EValidatorRegistrar)
def register(EValidatorRegistrar)
toLightweightTypeReference(JvmTypeReference)
protected def toLightweightTypeReference(JvmTypeReference) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Replies the lightweight type reference that is corresponding to the given type reference.
Parameters:
typeRef - the source type reference.
Returns:
the lightweight type reference.
toLightweightTypeReference(JvmTypeReference,boolean)
protected def toLightweightTypeReference(JvmTypeReference,boolean) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Replies the lightweight type reference that is corresponding to the given type reference.
Parameters:
typeRef - the source type reference.
keepUnboundWildcardInformation - indicates if the wildcard information are kept in the lightweight reference.
Returns:
the lightweight type reference.
typeName(XtendTypeDeclaration)
protected def typeName(XtendTypeDeclaration) : java.lang.String
Replies the label for the given type that is composed by the type's label and the type's name.
Parameters:
declaration - the declaration to analyse.
Returns:
the label for the type.
Since:
0.14