io.sarl.lang.typesystem
Class DefaultImmutableTypeValidator
All Superinterfaces:
IImmutableTypeValidator
@javax.inject.Singleton
class DefaultImmutableTypeValidator
extends java.lang.Object
implements IImmutableTypeValidator
Tool for validating the types against their immutability.

An immutable type is a type those state cannot be changed after it is constructed.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.8
Field Summary
Modifier and type Field and description
public static val java.lang.Class<T> IMMUTABLE_TYPE_ANNOTATIONS
List of the annotations that are known to mark the types as immutable.
public static val java.lang.Class<T> IMMUTABLE_TYPES
List of the well-known immutable types from Java, that are also considered as immutable in SARL.
Constructor Summary
Constructor and description
new
Action Summary
Modifier and type Action and description
protected boolean hasImmutableAnnotation(LightweightTypeReference)
Replies if the given type is marked with an annotation that makes it immutable.
protected boolean isAlwaysImmutable(LightweightTypeReference)
Replies if the given type is always assumed to be immutable.
protected boolean isAlwaysMutable(LightweightTypeReference)
Replies if the given type is always assumed to be mutable.
boolean isImmutable(LightweightTypeReference)
protected boolean isRegisteredImmutableType(LightweightTypeReference)
Replies if the given type is known as an immutable type.
void setAnnotationLookup(AnnotationLookup)
Change the JVM annotation finder that is used by this immutable type validator.
Field Details
IMMUTABLE_TYPE_ANNOTATIONS
public static val IMMUTABLE_TYPE_ANNOTATIONS : java.lang.Class<T>
List of the annotations that are known to mark the types as immutable.
Since:
0.12
IMMUTABLE_TYPES
public static val IMMUTABLE_TYPES : java.lang.Class<T>
List of the well-known immutable types from Java, that are also considered as immutable in SARL.
Since:
0.12
Constructor Details
new
new
Action Details
hasImmutableAnnotation(LightweightTypeReference)
protected def hasImmutableAnnotation(LightweightTypeReference) : boolean
Replies if the given type is marked with an annotation that makes it immutable.
Parameters:
ref - the type to test.
Returns:
true if the given type is annotated with an immutable type annotation; or false if it is not known yet that the type is immutable or not.
See:
IMMUTABLE_TYPE_ANNOTATIONS
isAlwaysImmutable(LightweightTypeReference)
protected def isAlwaysImmutable(LightweightTypeReference) : boolean
Replies if the given type is always assumed to be immutable.
Parameters:
ref - the type to test.
Returns:
true if the given type is always immutable; or false if it is not known yet that the type is immutable or not.
isAlwaysMutable(LightweightTypeReference)
protected def isAlwaysMutable(LightweightTypeReference) : boolean
Replies if the given type is always assumed to be mutable.
Parameters:
ref - the type to test.
Returns:
true if the given type is always mutable; or false if it is not known yet that the type is mutable or not.
isImmutable(LightweightTypeReference)
def isImmutable(LightweightTypeReference) : boolean
isRegisteredImmutableType(LightweightTypeReference)
protected def isRegisteredImmutableType(LightweightTypeReference) : boolean
Replies if the given type is known as an immutable type.
Parameters:
ref - the type to test.
Returns:
true if the given type is an immutable type; or false if it is not known yet that the type is immutable or not.
See:
IMMUTABLE_TYPES
setAnnotationLookup(AnnotationLookup)
def setAnnotationLookup(AnnotationLookup)
Change the JVM annotation finder that is used by this immutable type validator.
Parameters:
finder - the new finder, must not be null.