io.sarl.lang.core.annotations
Class Util
Enclosing class:
SarlAccessorsProcessor
class Util
extends java.lang.Object
Utilities for the accessor processor. This class is overridden for fixing Issue #1073.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
core
Since:
0.12
Constructor Summary
Constructor and description
new(TransformationContext)
Constructor.
Action Summary
Modifier and type Action and description
void addSetter(MutableFieldDeclaration,Visibility)
protected java.lang.Object fieldOwner(MutableFieldDeclaration)
Replies the owner of the given field.
protected boolean isInheritedVarargMethod(MutableTypeDeclaration,String,TypeReference)
Replies if the given method is inherited from a supertype and considered the varargs arguments.
protected org.eclipse.xtend.lib.macro.declaration.TypeReference orObject(TypeReference)
Replies the given reference if it not null, or the Object type if it is null.
Constructor Details
new(TransformationContext)
new(TransformationContext)
Constructor.
Parameters:
context - the accessor context.
Action Details
addSetter(MutableFieldDeclaration,Visibility)
def addSetter(MutableFieldDeclaration,Visibility)
fieldOwner(MutableFieldDeclaration)
protected def fieldOwner(MutableFieldDeclaration) : java.lang.Object
Replies the owner of the given field. It may be this or the class (if the field is static).
Parameters:
it - the field declaration.
Returns:
the enclosing type if the field is static, otherwise this .
isInheritedVarargMethod(MutableTypeDeclaration,String,TypeReference)
protected def isInheritedVarargMethod(MutableTypeDeclaration,String,TypeReference) : boolean
Replies if the given method is inherited from a supertype and considered the varargs arguments.
Parameters:
type - the type to check and from which the hierarchy is explored.
name - the name of the method to search for.
paramType - the variadic argument type.
Returns:
true if the method is inherited.
orObject(TypeReference)
protected def orObject(TypeReference) : org.eclipse.xtend.lib.macro.declaration.TypeReference
Replies the given reference if it not null, or the Object type if it is null.
Parameters:
ref - the reference.
Returns:
the reference or the reference to Object .