io.sarl.lang.jvmmodel
Class SARLJvmModelInferrer
All Superinterfaces:
org.eclipse.xtext.xbase.jvmmodel.IJvmModelInferrer
@javax.inject.Singleton
class SARLJvmModelInferrer
extends java.lang.Object
Infers a JVM model from the source model.

The JVM model should contain all elements that would appear in the Java code which is generated from the source model. Other models link against the JVM model rather than the source model.

The roles of the different generation tools are:
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Constructor Summary
Constructor and description
new
Action Summary
Modifier and type Action and description
protected final void addDefaultConstructor(XtendClass,JvmGenericType)
protected void appendAOPMembers(JvmGenericType,XtendTypeDeclaration,GenerationContext)
Generate the code for the given SARL members in a agent-oriented container.
protected void appendCapacityContextAwareWrapper(SarlCapacity,JvmGenericType)
Initialize the SARL capacity context-aware wrapper.
protected void appendCloneFunction(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Append the clone function.
protected void appendCloneFunctionIfCloneable(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Append the clone function only if the type is a subtype of Cloneable.
protected void appendComparisonFunctions(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Create the functions that permits to compare the object.
protected void appendConstrainedExtends(GenerationContext,JvmGenericType,Class<T>,Class<T>,List<E>)
Generate the extended types for the given SARL statement.
protected void appendConstrainedExtends(GenerationContext,JvmGenericType,Class<T>,Class<T>,JvmParameterizedTypeReference)
Generate the extended types for the given SARL statement.
protected void appendConstrainedImplements(GenerationContext,JvmGenericType,Class<T>,Class<T>,List<E>)
Generate the implemented types for the given SARL statement.
protected void appendDefaultConstructors(XtendTypeDeclaration,JvmGenericType)
Add the default constructors.
protected java.lang.String appendEventGuardEvaluatorForReflectMethod(Pair<K,V>,JvmGenericType,GenerationContext)
Append the guard evaluators for the reflection-based method.
protected void appendEventGuardEvaluators(JvmGenericType)
Append the guard evaluators.
protected void appendEventGuardEvaluatorsForPolymorphicMethod(Map<K,V>,boolean,JvmGenericType,GenerationContext)
Append the guard evaluators for the polymorphic method.
protected void appendFunctionalInterfaceAnnotation(JvmGenericType)
Append the @FunctionalInterface to the given type if it is a functional interface according to the Java 8 specification definition.
protected final void appendGeneratedAnnotation(JvmAnnotationTarget,GenerationContext)
Add the @Generated annotation to the given target.
protected void appendGeneratedAnnotation(JvmAnnotationTarget,GenerationContext,String)
Add the @Generated annotation to the given target.
protected void appendInjectableAnnotationIfInjectable(JvmDeclaredType,GenerationContext)
Append the injectable annotation to the given container.
protected void appendSARLElementType(XtendTypeDeclaration,JvmDeclaredType)
Append the SARL element type as an annotation to the given container.
protected void appendSARLSpecificationVersion(GenerationContext,XtendTypeDeclaration,JvmDeclaredType)
Append the SARL specification version as an annotation to the given container.
protected void appendSerialNumber(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Append the serial number field.
protected void appendSerialNumberIfSerializable(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Append the serial number field if and only if the container type is serializable.
protected void appendSyntheticDefaultValuedParameterMethods(XtendTypeDeclaration,JvmDeclaredType,boolean,GenerationContext)
Generate the missed operations that are the results from the generation of actions with default value parameters.
protected void appendToStringFunctions(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Create the functions that are related to the toString function.
protected org.eclipse.xtext.common.types.JvmTypeReference cloneWithProxiesFromOtherResource(JvmTypeReference,JvmOperation)
Clone the given type reference that is associated to another Xtext resource.
protected org.eclipse.xtext.common.types.JvmTypeReference cloneWithTypeParametersAndProxies(JvmTypeReference,JvmExecutable)
Clone the given type reference that for being link to the given executable component.
protected final void closeContext(GenerationContext)
Close a generation context.
protected boolean copyAndCleanDocumentationTo(XtendExecutable,JvmExecutable)
Copy and clean the given documentation by removing any unecessary @param.
protected boolean copyAndCleanDocumentationTo(JvmExecutable,JvmExecutable)
Copy and clean the given documentation by removing any unnecessary @param.
protected void copyNonStaticPublicJvmOperations(JvmGenericType,JvmGenericType,Set<E>,boolean,Procedure2<P1,P2>)
Copy the JVM operations from the source to the destination.
protected void copyTypeParametersFromJvmOperation(JvmOperation,JvmOperation)
Copy the type parameters from a JvmOperation.
protected void copyVisibleJvmConstructors(GenerationContext,JvmGenericType,JvmGenericType,XtendTypeDeclaration,Set<E>,JvmVisibility)
Copy the JVM constructors from the source to the destination.
protected org.eclipse.xtext.common.types.JvmOperation deriveGenericDispatchOperationSignature(Iterable<T>,JvmGenericType)
protected org.eclipse.xtext.common.types.JvmDeclaredType doInferTypeSceleton(XtendTypeDeclaration,IJvmDeclaredTypeAcceptor,boolean,XtendFile,List<E>)
protected final io.sarl.lang.jvmmodel.GenerationContext getContext(JvmIdentifiableElement)
Replies the SARL-specific generation context.
protected java.util.List<E> getTypeParametersFor(XtendTypeDeclaration)
Replies the type parameters for the given type.
protected org.eclipse.xtext.common.types.JvmTypeReference inferFunctionReturnType(XExpression)
Infer the function's return type.
protected org.eclipse.xtext.common.types.JvmTypeReference inferFunctionReturnType(XtendFunction,JvmOperation,JvmOperation)
Infer the return type for the given source function.
void inferLocalClass(AnonymousClass,String,JvmFeature)
.
protected void initialize(SarlAgent,JvmGenericType)
Initialize the SARL agent type.
protected void initialize(SarlArtifact,JvmGenericType)
Initialize the SARL artifact type.
protected void initialize(SarlBehavior,JvmGenericType)
Initialize the SARL behavior type.
protected void initialize(SarlCapacity,JvmGenericType)
Initialize the SARL capacity type.
protected void initialize(SarlEvent,JvmGenericType)
Initialize the SARL event type.
protected void initialize(SarlSkill,JvmGenericType)
Initialize the SARL skill type.
protected void initialize(SarlSpace,JvmGenericType)
Initialize the SARL space type.
protected void initialize(XtendAnnotationType,JvmAnnotationType)
protected void initialize(XtendClass,JvmGenericType)
protected void initialize(XtendEnum,JvmEnumerationType)
protected void initialize(XtendInterface,JvmGenericType)
protected void initializeLocalTypes(GenerationContext,JvmFeature,XExpression)
Initialize the local class to the given expression.
protected boolean isAccessibleTypeAccordingToJavaSpecifications(GenerationContext,JvmDeclaredType)
Replies if the given type is accessible according to the Java specifications.
protected void logInternalError(String)
Log an internal error but do not fail.
protected void logInternalError(Throwable)
Log an internal error but do not fail.
protected final io.sarl.lang.jvmmodel.GenerationContext openContext(EObject,JvmDeclaredType,Iterable<T>)
Open the context for the generation of a SARL-specific element.
protected void setBody(JvmExecutable,StringConcatenationClient)
Set the body of the executable.
protected void setBody(JvmExecutable,Procedure1<Param>)
Set the body of the executable.
protected void setBody(JvmExecutable,XExpression)
.
protected org.eclipse.xtext.common.types.JvmTypeReference skipTypeParameters(JvmTypeReference,Notifier)
Remove the type parameters from the given type.
protected void transform(SarlBehaviorUnit,JvmGenericType)
Transform the given behavior unit.
protected void transform(SarlCapacityUses,JvmGenericType)
Transform the uses of SARL capacities.
protected void transform(SarlRequiredCapacity,JvmGenericType)
Transform the requirements of SARL capacities.
protected void transform(XtendConstructor,JvmGenericType)
Transform the constructor.
protected void transform(XtendField,JvmGenericType)
Transform the field.
protected void transform(XtendFunction,JvmGenericType,boolean)
Transform the function.
protected void transform(XtendMember,JvmGenericType,boolean)
protected void translateAnnotationsTo(List<E>,JvmAnnotationTarget,Class<T>*)
Copy the annotations, except the ones given as parameters.
protected void translateSarlFormalParameters(GenerationContext,JvmExecutable,JvmGenericType,boolean,List<E>,boolean,List<E>,boolean)
Generate a list of formal parameters with annotations for the default values.
protected void translateSarlFormalParametersForLocalHiddenDefaultValues(GenerationContext,JvmOperation)
Generate the local default values.
protected java.util.List<E> translateSarlFormalParametersForSyntheticOperation(JvmExecutable,JvmGenericType,boolean,List<E>)
Generate a list arguments from the formal parameters in order to be used for a call into a synthetic operation, such as default-valued parameter function.
Constructor Details
new
new
Action Details
addDefaultConstructor(XtendClass,JvmGenericType)
protected def addDefaultConstructor(XtendClass,JvmGenericType)
appendAOPMembers(JvmGenericType,XtendTypeDeclaration,GenerationContext)
protected def appendAOPMembers(JvmGenericType,XtendTypeDeclaration,GenerationContext)
Generate the code for the given SARL members in a agent-oriented container.
Parameters:
featureContainerType - the feature container.
container - the SARL container.
context - description of the generation context in which the members must be considered.
appendCapacityContextAwareWrapper(SarlCapacity,JvmGenericType)
protected def appendCapacityContextAwareWrapper(SarlCapacity,JvmGenericType)
Initialize the SARL capacity context-aware wrapper.
Parameters:
source - the source.
inferredJvmType - the JVM type.
Since:
0.6
appendCloneFunction(GenerationContext,XtendTypeDeclaration,JvmGenericType)
protected def appendCloneFunction(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Append the clone function.

The clone function replies a value of the current type, not Object.
Parameters:
context - the current generation context.
source - the source object.
target - the inferred JVM object.
Since:
0.6
See:
appendCloneFunctionIfCloneable(GenerationContext,XtendTypeDeclaration,JvmGenericType)
appendCloneFunctionIfCloneable(GenerationContext,XtendTypeDeclaration,JvmGenericType)
protected def appendCloneFunctionIfCloneable(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Append the clone function only if the type is a subtype of Cloneable.

The clone function replies a value of the current type, not Object.
Parameters:
context - the current generation context.
source - the source object.
target - the inferred JVM object.
Since:
0.6
See:
appendCloneFunction(GenerationContext,XtendTypeDeclaration,JvmGenericType)
appendComparisonFunctions(GenerationContext,XtendTypeDeclaration,JvmGenericType)
protected def appendComparisonFunctions(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Create the functions that permits to compare the object. The comparaison functions are equals(Object) and hashCode().
Parameters:
context - the current generation context.
source - the source object.
target - the inferred JVM object.
appendConstrainedExtends(GenerationContext,JvmGenericType,Class<T>,Class<T>,List<E>)
protected def appendConstrainedExtends(GenerationContext,JvmGenericType,Class<T>,Class<T>,List<E>)
Generate the extended types for the given SARL statement.
Parameters:
context - the context of the generation.
owner - the JVM element to change.
defaultJvmType - the default JVM type.
defaultSarlType - the default Sarl type.
supertypes - the supertypes.
appendConstrainedExtends(GenerationContext,JvmGenericType,Class<T>,Class<T>,JvmParameterizedTypeReference)
protected def appendConstrainedExtends(GenerationContext,JvmGenericType,Class<T>,Class<T>,JvmParameterizedTypeReference)
Generate the extended types for the given SARL statement.
Parameters:
context - the context of the generation.
owner - the JVM element to change.
defaultJvmType - the default JVM type.
defaultSarlType - the default SARL type.
supertype - the supertype.
appendConstrainedImplements(GenerationContext,JvmGenericType,Class<T>,Class<T>,List<E>)
protected def appendConstrainedImplements(GenerationContext,JvmGenericType,Class<T>,Class<T>,List<E>)
Generate the implemented types for the given SARL statement.
Parameters:
context - the context of the generation.
owner - the JVM element to change.
defaultJvmType - the default JVM type.
defaultSarlType - the default SARL type.
implementedtypes - the implemented types.
appendDefaultConstructors(XtendTypeDeclaration,JvmGenericType)
protected def appendDefaultConstructors(XtendTypeDeclaration,JvmGenericType)
Add the default constructors.

The default constructors have the same signature as the constructors of the super class.

This function adds the default constructors if no constructor was already added. This condition is determined with a call to hasConstructor().
Parameters:
source - the SARL element in which no constructor was specified. This SARL element should be associated to the target element.
target - the JVM type that is receiving the default constructor.
See:
hasConstructor
appendEventGuardEvaluatorForReflectMethod(Pair<K,V>,JvmGenericType,GenerationContext)
protected def appendEventGuardEvaluatorForReflectMethod(Pair<K,V>,JvmGenericType,GenerationContext) : java.lang.String
Append the guard evaluators for the reflection-based method.
Parameters:
evaluators - the guard evaluators to generate.
container - the receiver of the generated components.
context - the generation context.
Returns:
the name of the generated function.
Since:
0.12
appendEventGuardEvaluators(JvmGenericType)
protected def appendEventGuardEvaluators(JvmGenericType)
Append the guard evaluators.
Parameters:
container - the container type.
appendEventGuardEvaluatorsForPolymorphicMethod(Map<K,V>,boolean,JvmGenericType,GenerationContext)
protected def appendEventGuardEvaluatorsForPolymorphicMethod(Map<K,V>,boolean,JvmGenericType,GenerationContext)
Append the guard evaluators for the polymorphic method.
Parameters:
guardDefs - the definition of the guards.
isRootType - indicates if the containing type is considered as a root type from the polymorphic method point of view.
container - the receiver of the generated components.
context - the generation context.
Since:
0.12
appendFunctionalInterfaceAnnotation(JvmGenericType)
protected def appendFunctionalInterfaceAnnotation(JvmGenericType)
Append the @FunctionalInterface to the given type if it is a functional interface according to the Java 8 specification definition.
Parameters:
type - the type to update.
appendGeneratedAnnotation(JvmAnnotationTarget,GenerationContext)
protected def appendGeneratedAnnotation(JvmAnnotationTarget,GenerationContext)
Add the @Generated annotation to the given target. The annotation will not have any generated SARL code associated to it.
Parameters:
target - the target of the annotation.
context - the generation context.
appendGeneratedAnnotation(JvmAnnotationTarget,GenerationContext,String)
protected def appendGeneratedAnnotation(JvmAnnotationTarget,GenerationContext,String)
Add the @Generated annotation to the given target.
Parameters:
target - the target of the annotation.
context - the generation context.
sarlCode - the code that is the cause of the generation.
appendInjectableAnnotationIfInjectable(JvmDeclaredType,GenerationContext)
protected def appendInjectableAnnotationIfInjectable(JvmDeclaredType,GenerationContext)
Append the injectable annotation to the given container.
Parameters:
target - the inferred JVM object.
context - the generation context.
Since:
0.12
appendSARLElementType(XtendTypeDeclaration,JvmDeclaredType)
protected def appendSARLElementType(XtendTypeDeclaration,JvmDeclaredType)
Append the SARL element type as an annotation to the given container.

The added annotation may be used by any underground platform for determining what is the type of the SARL element without invoking the costly "instanceof" operations.
Parameters:
source - the source object.
target - the inferred JVM object.
appendSARLSpecificationVersion(GenerationContext,XtendTypeDeclaration,JvmDeclaredType)
protected def appendSARLSpecificationVersion(GenerationContext,XtendTypeDeclaration,JvmDeclaredType)
Append the SARL specification version as an annotation to the given container.

The added annotation may be used by any underground platform for determining what is the version of the SARL specification that was used for generating the container.
Parameters:
context - the current generation context.
source - the source object.
target - the inferred JVM object.
appendSerialNumber(GenerationContext,XtendTypeDeclaration,JvmGenericType)
protected def appendSerialNumber(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Append the serial number field.

The serial number field is computed from the given context and from the generated fields. The field is added if no field with name "serialVersionUID" was defined.

This function does not test if the field container is serializable.
Parameters:
context - the current generation context.
source - the source object.
target - the inferred JVM object.
See:
appendSerialNumberIfSerializable(GenerationContext,XtendTypeDeclaration,JvmGenericType)
appendSerialNumberIfSerializable(GenerationContext,XtendTypeDeclaration,JvmGenericType)
protected def appendSerialNumberIfSerializable(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Append the serial number field if and only if the container type is serializable.

The serial number field is computed from the given context and from the generated fields.
Parameters:
context - the current generation context.
source - the source object.
target - the inferred JVM object.
See:
appendSerialNumber(GenerationContext,XtendTypeDeclaration,JvmGenericType)
appendSyntheticDefaultValuedParameterMethods(XtendTypeDeclaration,JvmDeclaredType,boolean,GenerationContext)
protected def appendSyntheticDefaultValuedParameterMethods(XtendTypeDeclaration,JvmDeclaredType,boolean,GenerationContext)
Generate the missed operations that are the results from the generation of actions with default value parameters.
Parameters:
source - the SARL container.
target - the JVM feature container.
ignoreOverridableOperations - indicates if the operations must not be added if they are marked has overridable.
context - description of the generation context in which the members must be considered.
appendToStringFunctions(GenerationContext,XtendTypeDeclaration,JvmGenericType)
protected def appendToStringFunctions(GenerationContext,XtendTypeDeclaration,JvmGenericType)
Create the functions that are related to the toString function.
Parameters:
context - the current generation context.
source - the source object.
target - the inferred JVM object.
cloneWithProxiesFromOtherResource(JvmTypeReference,JvmOperation)
protected def cloneWithProxiesFromOtherResource(JvmTypeReference,JvmOperation) : org.eclipse.xtext.common.types.JvmTypeReference
Clone the given type reference that is associated to another Xtext resource.

This function ensures that the resource of the reference clone is not pointing to the resource of the original reference.

This function calls cloneWithProxies(JvmTypeReference) or cloneWithTypeParametersAndProxies(JvmTypeReference, JvmExecutable) if the target is null for the first, and not null for the second.
Parameters:
type - the source type.
target - the operation for which the type is clone, or null if not relevant.
Returns:
the result type, i.e. a copy of the source type.
cloneWithTypeParametersAndProxies(JvmTypeReference,JvmExecutable)
protected def cloneWithTypeParametersAndProxies(JvmTypeReference,JvmExecutable) : org.eclipse.xtext.common.types.JvmTypeReference
Clone the given type reference that for being link to the given executable component.

The proxies are not resolved, and the type parameters are clone when they are related to the type parameter of the executable or the type container.
Parameters:
type - the source type.
forExecutable - the executable component that will contain the result type.
Returns:
the result type, i.e. a copy of the source type.
closeContext(GenerationContext)
protected def closeContext(GenerationContext)
Close a generation context.
Parameters:
context - the context to be closed.
copyAndCleanDocumentationTo(XtendExecutable,JvmExecutable)
protected def copyAndCleanDocumentationTo(XtendExecutable,JvmExecutable) : boolean
Copy and clean the given documentation by removing any unecessary @param.
Parameters:
sourceOperation - the source for the documentation.
targetOperation - the target for the documentation.
Returns:
true if a documentation was added.
copyAndCleanDocumentationTo(JvmExecutable,JvmExecutable)
protected def copyAndCleanDocumentationTo(JvmExecutable,JvmExecutable) : boolean
Copy and clean the given documentation by removing any unnecessary @param.
Parameters:
sourceOperation - the source for the documentation.
targetOperation - the target for the documentation.
Returns:
true if a documentation was added.
copyNonStaticPublicJvmOperations(JvmGenericType,JvmGenericType,Set<E>,boolean,Procedure2<P1,P2>)
protected def copyNonStaticPublicJvmOperations(JvmGenericType,JvmGenericType,Set<E>,boolean,Procedure2<P1,P2>)
Copy the JVM operations from the source to the destination.
Parameters:
source - the source.
target - the destination.
createdActions - the set of actions that are created before (input) or during (output) the invocation.
copyHiddenNames - indicates if the operations with hidden name are copied.
bodyBuilder - the builder of the target's operations.
Since:
0.12
copyTypeParametersFromJvmOperation(JvmOperation,JvmOperation)
protected def copyTypeParametersFromJvmOperation(JvmOperation,JvmOperation)
Copy the type parameters from a JvmOperation.

This function differs from copyAndFixTypeParameters(List, org.eclipse.xtext.common.types.JvmTypeParameterDeclarator) and copyTypeParameters(List, org.eclipse.xtext.common.types.JvmTypeParameterDeclarator) in the fact that the type parameters were already generated and fixed. The current function supper generic types by clone the types references with cloneWithTypeParametersAndProxies(JvmTypeReference, JvmExecutable).
Parameters:
fromOperation - the operation from which the type parameters are copied.
toOperation - the operation that will receives the new type parameters.
copyVisibleJvmConstructors(GenerationContext,JvmGenericType,JvmGenericType,XtendTypeDeclaration,Set<E>,JvmVisibility)
protected def copyVisibleJvmConstructors(GenerationContext,JvmGenericType,JvmGenericType,XtendTypeDeclaration,Set<E>,JvmVisibility)
Copy the JVM constructors from the source to the destination.
Parameters:
context - the current generation context.
source - the source.
target - the destination.
sarlSource - the SARL source element. If null, the generated constructors will not be associated to the SARL element.
createdConstructors - the set of constructors that are created before (input) or during (output) the invocation.
minimalVisibility - the minimal visibility to apply to the created constructors.
Since:
0.10
deriveGenericDispatchOperationSignature(Iterable<T>,JvmGenericType)
protected def deriveGenericDispatchOperationSignature(Iterable<T>,JvmGenericType) : org.eclipse.xtext.common.types.JvmOperation
doInferTypeSceleton(XtendTypeDeclaration,IJvmDeclaredTypeAcceptor,boolean,XtendFile,List<E>)
protected def doInferTypeSceleton(XtendTypeDeclaration,IJvmDeclaredTypeAcceptor,boolean,XtendFile,List<E>) : org.eclipse.xtext.common.types.JvmDeclaredType
getContext(JvmIdentifiableElement)
protected def getContext(JvmIdentifiableElement) : io.sarl.lang.jvmmodel.GenerationContext
Replies the SARL-specific generation context.
Parameters:
type - the generated type.
Returns:
the SARL-specific generation context.
getTypeParametersFor(XtendTypeDeclaration)
protected def getTypeParametersFor(XtendTypeDeclaration) : java.util.List<E>
Replies the type parameters for the given type.
Parameters:
type - the type.
Returns:
the type parameters for the given type.
inferFunctionReturnType(XExpression)
protected def inferFunctionReturnType(XExpression) : org.eclipse.xtext.common.types.JvmTypeReference
Infer the function's return type.
Parameters:
body - the body of the function.
Returns:
the return type.
inferFunctionReturnType(XtendFunction,JvmOperation,JvmOperation)
protected def inferFunctionReturnType(XtendFunction,JvmOperation,JvmOperation) : org.eclipse.xtext.common.types.JvmTypeReference
Infer the return type for the given source function.
Parameters:
source - the source function.
target - the target operation.
overriddenOperation - reference to the overridden operation.
Returns:
the inferred return type.
Since:
0.7
inferLocalClass(AnonymousClass,String,JvmFeature)
def inferLocalClass(AnonymousClass,String,JvmFeature)
.

The function is overridden in order to interleave the instructions from Xtend and the ones needed for SARL.
initialize(SarlAgent,JvmGenericType)
protected def initialize(SarlAgent,JvmGenericType)
Initialize the SARL agent type.
Parameters:
source - the source.
inferredJvmType - the JVM type.
initialize(SarlArtifact,JvmGenericType)
protected def initialize(SarlArtifact,JvmGenericType)
Initialize the SARL artifact type.
Parameters:
source - the source.
inferredJvmType - the JVM type.
initialize(SarlBehavior,JvmGenericType)
protected def initialize(SarlBehavior,JvmGenericType)
Initialize the SARL behavior type.
Parameters:
source - the source.
inferredJvmType - the JVM type.
initialize(SarlCapacity,JvmGenericType)
protected def initialize(SarlCapacity,JvmGenericType)
Initialize the SARL capacity type.
Parameters:
source - the source.
inferredJvmType - the JVM type.
initialize(SarlEvent,JvmGenericType)
protected def initialize(SarlEvent,JvmGenericType)
Initialize the SARL event type.
Parameters:
source - the source.
inferredJvmType - the JVM type.
initialize(SarlSkill,JvmGenericType)
protected def initialize(SarlSkill,JvmGenericType)
Initialize the SARL skill type.
Parameters:
source - the source.
inferredJvmType - the JVM type.
initialize(SarlSpace,JvmGenericType)
protected def initialize(SarlSpace,JvmGenericType)
Initialize the SARL space type.
Parameters:
source - the source.
inferredJvmType - the JVM type.
initialize(XtendAnnotationType,JvmAnnotationType)
protected def initialize(XtendAnnotationType,JvmAnnotationType)
initialize(XtendClass,JvmGenericType)
protected def initialize(XtendClass,JvmGenericType)
initialize(XtendEnum,JvmEnumerationType)
protected def initialize(XtendEnum,JvmEnumerationType)
initialize(XtendInterface,JvmGenericType)
protected def initialize(XtendInterface,JvmGenericType)
initializeLocalTypes(GenerationContext,JvmFeature,XExpression)
protected def initializeLocalTypes(GenerationContext,JvmFeature,XExpression)
Initialize the local class to the given expression.
Parameters:
context - the generation context.
feature - the feature which contains the expression.
expression - the expression which contains the local class.
isAccessibleTypeAccordingToJavaSpecifications(GenerationContext,JvmDeclaredType)
protected def isAccessibleTypeAccordingToJavaSpecifications(GenerationContext,JvmDeclaredType) : boolean
Replies if the given type is accessible according to the Java specifications. Indeed, since Java11, several types, e.g. HotSpotIntrinsicCandidate annotation, are inaccessible because they are in private modules.
Parameters:
context - the generation context.
type - the type to test.
Returns:
true if the type is accessible.
logInternalError(String)
protected def logInternalError(String)
Log an internal error but do not fail.
Parameters:
message - the internal message.
logInternalError(Throwable)
protected def logInternalError(Throwable)
Log an internal error but do not fail.
Parameters:
exception - the exception to log.
openContext(EObject,JvmDeclaredType,Iterable<T>)
protected def openContext(EObject,JvmDeclaredType,Iterable<T>) : io.sarl.lang.jvmmodel.GenerationContext
Open the context for the generation of a SARL-specific element.
Parameters:
sarlObject - the SARL object that is the cause of the generation.
type - the generated type.
supportedMemberTypes - the types of the supported members.
Returns:
the created context.
setBody(JvmExecutable,StringConcatenationClient)
protected def setBody(JvmExecutable,StringConcatenationClient)
Set the body of the executable.
Parameters:
executable - the executable.
expression - the body definition.
setBody(JvmExecutable,Procedure1<Param>)
protected def setBody(JvmExecutable,Procedure1<Param>)
Set the body of the executable.
Parameters:
executable - the executable.
expression - the body definition.
setBody(JvmExecutable,XExpression)
protected def setBody(JvmExecutable,XExpression)
.

Overridden for: removing the existing associated body, and delaying the local type inference.
skipTypeParameters(JvmTypeReference,Notifier)
protected def skipTypeParameters(JvmTypeReference,Notifier) : org.eclipse.xtext.common.types.JvmTypeReference
Remove the type parameters from the given type.

Criteria for removal
Referenced type Input Replied referenced type Output
Type with generic type parameter T<G> the type itself T
Type without generic type parameter T the type itself T
Type parameter without bound <S> Object Object
Type parameter with lower bound <S super B> Object Object
Type parameter with upper bound <S extends B> the bound type B
Parameters:
type - the type.
context - the context in which the reference is located.
Returns:
the same type without the type parameters.
transform(SarlBehaviorUnit,JvmGenericType)
protected def transform(SarlBehaviorUnit,JvmGenericType)
Transform the given behavior unit.
Parameters:
source - the feature to transform.
container - the target container of the transformation result.
transform(SarlCapacityUses,JvmGenericType)
protected def transform(SarlCapacityUses,JvmGenericType)
Transform the uses of SARL capacities.

Resolving the calls to the capacities' functions is done in io.sarl.lang.typesystem.SARLReentrantTypeResolver.
Parameters:
source - the feature to transform.
container - the target container of the transformation result.
transform(SarlRequiredCapacity,JvmGenericType)
protected def transform(SarlRequiredCapacity,JvmGenericType)
Transform the requirements of SARL capacities.
Parameters:
source - the feature to transform.
container - the target container of the transformation result.
transform(XtendConstructor,JvmGenericType)
protected def transform(XtendConstructor,JvmGenericType)
Transform the constructor.
Parameters:
source - the feature to transform.
container - the target container of the transformation result.
transform(XtendField,JvmGenericType)
protected def transform(XtendField,JvmGenericType)
Transform the field.
Parameters:
source - the feature to transform.
container - the target container of the transformation result.
transform(XtendFunction,JvmGenericType,boolean)
protected def transform(XtendFunction,JvmGenericType,boolean)
Transform the function.
Parameters:
source - the feature to transform.
container - the target container of the transformation result.
transform(XtendMember,JvmGenericType,boolean)
protected def transform(XtendMember,JvmGenericType,boolean)
translateAnnotationsTo(List<E>,JvmAnnotationTarget,Class<T>*)
protected def translateAnnotationsTo(List<E>,JvmAnnotationTarget,Class<T>*)
Copy the annotations, except the ones given as parameters.
Parameters:
annotations - the annotations to copy.
target - the target.
exceptions - the annotations to skip.
translateSarlFormalParameters(GenerationContext,JvmExecutable,JvmGenericType,boolean,List<E>,boolean,List<E>,boolean)
protected def translateSarlFormalParameters(GenerationContext,JvmExecutable,JvmGenericType,boolean,List<E>,boolean,List<E>,boolean)
Generate a list of formal parameters with annotations for the default values.
Parameters:
context - the generation context.
owner - the JVM element to change.
actionContainer - the container of the action.
varargs - indicates if the signature has variadic parameter.
params - the parameters.
isForInterface - indicates if the formal parameters are for an interface (true) or a class (false).
paramSpec - the specification of the parameter as computed by a IActionPrototypeProvider.
ignoreOverridableOperations - indicates if the operations are ignored if it is marked as overridable.
translateSarlFormalParametersForLocalHiddenDefaultValues(GenerationContext,JvmOperation)
protected def translateSarlFormalParametersForLocalHiddenDefaultValues(GenerationContext,JvmOperation)
Generate the local default values.
Parameters:
context - the generation context.
inheritedOperation - the reference to the inherited operation.
Since:
0.12
translateSarlFormalParametersForSyntheticOperation(JvmExecutable,JvmGenericType,boolean,List<E>)
protected def translateSarlFormalParametersForSyntheticOperation(JvmExecutable,JvmGenericType,boolean,List<E>) : java.util.List<E>
Generate a list arguments from the formal parameters in order to be used for a call into a synthetic operation, such as default-valued parameter function.
Parameters:
owner - the JVM element to change.
actionContainer - the container of the action.
varargs - indicates if the signature has variadic parameter.
signature - the description of the parameters.
Returns:
the arguments to pass to the original function.