io.sarl.lang.validation
Interface ISARLValidator
All Known Implementing Classes:
Bug621Validator, SARLValidator
interface ISARLValidator
Tools for implementing the validators.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.14
Property Summary
Modifier and type Property and description
org.eclipse.xtext.validation.ValidationMessageAcceptor messageAcceptor
Replies the receiver of the issue messages.
org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices services
Replies the type computation services.
Action Summary
Modifier and type Action and description
abstract void addIssue(String,EObject,String)
Add an issue.
abstract void doCheckFinalFieldInitialization(JvmGenericType,ValidationMessageAcceptor)
Check of all the fields are properly initialized for the given type.
abstract void doCheckTypeParameterForwardReference(List<E>)
Check the type parameters for the given list.
abstract boolean doCheckValidSuperTypeArgumentDefinition(LightweightTypeReference,EObject,EStructuralFeature,int,boolean,ValidationMessageAcceptor)
Check if the given type has valid type arguments according to the type parameters of the referenced type.
abstract org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference getActualType(XExpression)
Replies the reference to the inferred type of the given expression.
abstract org.eclipse.xtext.xbase.compiler.GeneratorConfig getGeneratorConfig(EObject)
Replies the generator configuration that is used for creating the JVM objects.
abstract org.eclipse.xtext.validation.IssueSeverities getIssueSeverities(Map<K,V>,EObject)
Replies the issue severity provider.
abstract org.eclipse.xtext.validation.ValidationMessageAcceptor getMessageAcceptor
Replies the receiver of the issue messages.
abstract org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices getServices
Replies the type computation services.
abstract boolean isFinal(LightweightTypeReference)
Replies if the given type is declared as final (cannot be overridden).
abstract boolean isIgnored(String)
Replies if the issues with the given identifier should be ignored.
abstract boolean isIgnored(String,EObject)
Replies if the given issue is ignored for the given object.
abstract boolean isLocallyUsed(EObject,EObject)
Replies if the given target is marked as locally used in the given container.
abstract boolean isPrimitiveVoid(JvmTypeReference)
Replies if the given type corresponds to a primitive void.
abstract boolean isTypeParameterLocallyUsedInEvent(JvmTypeParameter,SarlEvent)
Replies if the given type parameter is locally used in the given event.
abstract boolean memberOfTypeHierarchy(LightweightTypeReference,LightweightTypeReference)
Replies if the given member is member of the type hierarchy of the given type.
abstract org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference toLightweightTypeReference(JvmTypeReference)
Create a lightweight type reference from the given type.
abstract org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference toLightweightTypeReference(JvmType,EObject)
Create a lightweight type reference from the given type.
abstract org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference toLightweightTypeReference(JvmTypeReference,boolean)
Create a lightweight type reference from the given type.
Property Details
messageAcceptor
val messageAcceptor : org.eclipse.xtext.validation.ValidationMessageAcceptor
Replies the receiver of the issue messages.

This property is an alias for the action: getMessageAcceptor

Returns:
the receiver of the issue messages.
services
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 services.
Action Details
addIssue(String,EObject,String)
def addIssue(String,EObject,String)
Add an issue.
Parameters:
message - the explanation message.
source - the source of the issue.
issueCode - the code of the issue.
doCheckFinalFieldInitialization(JvmGenericType,ValidationMessageAcceptor)
def doCheckFinalFieldInitialization(JvmGenericType,ValidationMessageAcceptor)
Check of all the fields are properly initialized for the given type.
Parameters:
type - the type to check.
acceptor - the message acceptor, may be null.
doCheckTypeParameterForwardReference(List<E>)
def doCheckTypeParameterForwardReference(List<E>)
Check the type parameters for the given list.
Parameters:
sourceTypeParameters - the list of type parameters to check.
doCheckValidSuperTypeArgumentDefinition(LightweightTypeReference,EObject,EStructuralFeature,int,boolean,ValidationMessageAcceptor)
def doCheckValidSuperTypeArgumentDefinition(LightweightTypeReference,EObject,EStructuralFeature,int,boolean,ValidationMessageAcceptor) : boolean
Check if the given type has valid type arguments according to the type parameters of the referenced type.
Parameters:
typeRef - the type reference to check.
context - the context in which the reference is defined, for finding the other types.
feature - the grammar feature that contains the typeRef.
superTypeIndex - the index of the feature in the grammar.
allowWildcard - indicates if wildcards are allowed in type conformance checking.
messageAcceptor - the acceptor of error and warning messages to be used.
Returns:
true of the reference is valid; false if the reference is invalid.
getActualType(XExpression)
def getActualType(XExpression) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Replies the reference to the inferred type of the given expression.
Parameters:
expression - the expression to evaluate
Returns:
the type of the given expression.
getGeneratorConfig(EObject)
def getGeneratorConfig(EObject) : org.eclipse.xtext.xbase.compiler.GeneratorConfig
Replies the generator configuration that is used for creating the JVM objects.
Parameters:
element -
Returns:
getIssueSeverities(Map<K,V>,EObject)
def getIssueSeverities(Map<K,V>,EObject) : org.eclipse.xtext.validation.IssueSeverities
Replies the issue severity provider.
Parameters:
context - the current context
eObject - the object.
Returns:
the severities.
getMessageAcceptor
def getMessageAcceptor : org.eclipse.xtext.validation.ValidationMessageAcceptor
Replies the receiver of the issue messages.
Returns:
the receiver of the issue messages.
getServices
def getServices : org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices
Replies the type computation services.
Returns:
the services.
isFinal(LightweightTypeReference)
def isFinal(LightweightTypeReference) : boolean
Replies if the given type is declared as final (cannot be overridden).
Parameters:
type - the type to test.
Returns:
true if the type is declared as final.
isIgnored(String)
def isIgnored(String) : boolean
Replies if the issues with the given identifier should be ignored.
Parameters:
issueCode - the code of the issue.
Returns:
true if the issue should be ignored.
See:
isIgnored(String,EObject)
isIgnored(String,EObject)
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)
isLocallyUsed(EObject,EObject)
def isLocallyUsed(EObject,EObject) : boolean
Replies if the given target is marked as locally used in the given container.
Parameters:
target - the object to check for its usage.
containerToFindUsage - the context of the use.
Returns:
true if the target is marked as used in the container.
isPrimitiveVoid(JvmTypeReference)
def isPrimitiveVoid(JvmTypeReference) : boolean
Replies if the given type corresponds to a primitive void.
Parameters:
typeReference - the type reference.
Returns:
true if the given type reference corresponds to a primitive void.
isTypeParameterLocallyUsedInEvent(JvmTypeParameter,SarlEvent)
def isTypeParameterLocallyUsedInEvent(JvmTypeParameter,SarlEvent) : boolean
Replies if the given type parameter is locally used in the given event.
Parameters:
parameter - the type parameter to search for a local usage.
event - the container in which the local uses should be checked.
Returns:
true if the type parameter is locally used.
memberOfTypeHierarchy(LightweightTypeReference,LightweightTypeReference)
def memberOfTypeHierarchy(LightweightTypeReference,LightweightTypeReference) : boolean
Replies if the given member is member of the type hierarchy of the given type.
Parameters:
type - the type for which the type hierarchy is computed.
potentialMember - the member to search for in the type hierarchy.
Returns:
true if potentialMember is defined inside the type hierarchy of the type .
toLightweightTypeReference(JvmTypeReference)
def toLightweightTypeReference(JvmTypeReference) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Create a lightweight type reference from the given type.
Parameters:
typeRef - the type to point to.
Returns:
the reference.
toLightweightTypeReference(JvmType,EObject)
def toLightweightTypeReference(JvmType,EObject) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Create a lightweight type reference from the given type.
Parameters:
type - the type to point to.
context - the context in which the reference is located.
Returns:
the reference.
toLightweightTypeReference(JvmTypeReference,boolean)
def toLightweightTypeReference(JvmTypeReference,boolean) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Create a lightweight type reference from the given type.
Parameters:
typeRef - the type to point to.
keepUnboundWildcardInformation - indicates if the wildcard information is kept.
Returns:
the reference.