Class TypeReferenceExtension
java.lang.Object
org.emftext.language.java.extensions.types.TypeReferenceExtension
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TypeReference
clone
(TypeReference me) static TypeReference
static Type
getBoundTarget
(TypeReference me, Reference reference) Returns the type referenced by thisTypeReference
considering all concrete subclasses ofTypeReference
used by the Java meta-model.static TypeReference
getBoundTargetReference
(TypeReference me, Reference reference) static ClassifierReference
Extracts the (possibly nested) ClassifierReference (if any) from a TypeReference.static Type
Returns the type referenced by thisTypeReference
considering all concrete subclasses ofTypeReference
used by the Java meta-model.static TypeReference
Returns the type reference for a type argument.static TypeReference
getTypeReferenceOfTypeArgument
(TypeReference ref, int index) static void
setTarget
(TypeReference me, Classifier type) Sets the type targeted by this type reference.
-
Constructor Details
-
TypeReferenceExtension
public TypeReferenceExtension()
-
-
Method Details
-
getTarget
Returns the type referenced by thisTypeReference
considering all concrete subclasses ofTypeReference
used by the Java meta-model.- Parameters:
me
- the type reference to obtain the type from.- Returns:
- the referenced type
-
setTarget
Sets the type targeted by this type reference.- Parameters:
me
- the type reference whose type is set.type
- the new type to set as target.
-
getBoundTarget
Returns the type referenced by thisTypeReference
considering all concrete subclasses ofTypeReference
used by the Java meta-model. If type parameters are bound in the given reference, the bound type will be returned instead of the parameter.- Parameters:
me
- the type reference to obtain the type for.reference
- the context of the type reference.- Returns:
- the referenced type.
-
getBoundTargetReference
-
getTypeReferenceOfTypeArgument
-
getTypeReferenceOfTypeArgument
Returns the type reference for a type argument. If the type argument is a QualifiedTypeArgument, the returned type reference is the qualified type. If the type argument is a SuperTypeArgument, the lower bound is returned. If the type argument is an ExtendsTypeArgument, the upper bound is returned. If the type argument is an UnknownTypeArgument, null is returned.- Parameters:
arg
- the type argument.- Returns:
- the type reference for the type argument or null.
-
convertToTypeReference
-
clone
-
getPureClassifierReference
Extracts the (possibly nested) ClassifierReference (if any) from a TypeReference.- Parameters:
me
- the TypeReference to extract the ClassifierReference from.- Returns:
- the extracted ClassifierReference.
-