public class CompoundTypeReference extends LightweightTypeReference
LightweightTypeReference.IdentifierFunction, LightweightTypeReference.JavaIdentifierFunction, LightweightTypeReference.SimpleNameFunction, LightweightTypeReference.UniqueIdentifierFunctionKIND_ANY_TYPE_REFERENCE, KIND_ARRAY_TYPE_REFERENCE, KIND_COMPOUND_TYPE_REFERENCE, KIND_FUNCTION_TYPE_REFERENCE, KIND_INNER_FUNCTION_TYPE_REFERENCE, KIND_INNER_TYPE_REFERENCE, KIND_LIGHTWEIGHT_TYPE_REFERENCE, KIND_PARAMETERIZED_TYPE_REFERENCE, KIND_UNBOUND_TYPE_REFERENCE, KIND_UNKNOWN_TYPE_REFERENCE, KIND_WILDCARD_TYPE_REFERENCE| Constructor and Description |
|---|
CompoundTypeReference(ITypeReferenceOwner owner,
boolean synonym) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(TypeReferenceVisitor visitor) |
<Param> void |
accept(TypeReferenceVisitorWithParameter<Param> visitor,
Param param) |
<Param,Result> |
accept(TypeReferenceVisitorWithParameterAndResult<Param,Result> visitor,
Param param) |
<Result> Result |
accept(TypeReferenceVisitorWithResult<Result> visitor) |
void |
addComponent(LightweightTypeReference component) |
protected LightweightTypeReference |
doCopyInto(ITypeReferenceOwner owner) |
LightweightTypeReference |
getComponentType()
Returns the component type of the current array type.
|
FunctionTypeKind |
getFunctionTypeKind() |
java.lang.String |
getIdentifier()
Returns the identifier of this type reference.
|
java.lang.String |
getJavaIdentifier() |
int |
getKind()
Subclasses must override this method.
|
java.util.List<LightweightTypeReference> |
getMultiTypeComponents() |
LightweightTypeReference |
getRawTypeReference() |
java.lang.String |
getSimpleName()
Prints the simple name of this type reference.
|
LightweightTypeReference |
getSuperType(java.lang.Class<?> rawType)
Returns the resolved super type for the given raw type or
null if the raw type
is not a valid super type of this type. |
LightweightTypeReference |
getSuperType(org.eclipse.xtext.common.types.JvmType rawType)
Returns the resolved super type for the given raw type or null if the raw type
is not a valid super type of this type.
|
protected java.util.List<LightweightTypeReference> |
getSuperTypes(TypeParameterSubstitutor<?> substitutor) |
org.eclipse.xtext.common.types.JvmType |
getType() |
java.util.List<LightweightTypeReference> |
getTypeArguments()
Returns the type arguments of this reference if it has any.
|
java.lang.String |
getUniqueIdentifier()
Returns an identifier that allows to disambiguate type parameter names that have
different origins.
|
boolean |
isAnonymous() |
boolean |
isAny() |
boolean |
isArray() |
boolean |
isInterfaceType() |
boolean |
isMultiType() |
boolean |
isOwnedBy(ITypeReferenceOwner owner) |
boolean |
isPrimitive() |
boolean |
isPrimitiveVoid() |
boolean |
isRawType()
Returns
true is this type points to a raw type. |
boolean |
isResolved() |
boolean |
isSynonym() |
boolean |
isType(java.lang.Class<?> clazz)
Returns true if this type reference represents an type with the given
raw type
clazz. |
boolean |
isVisible(IVisibilityHelper visibilityHelper)
Returns
true if this type is fully visible according to the given visibilityHelper. |
boolean |
isWrapper() |
org.eclipse.xtext.common.types.JvmTypeReference |
toJavaCompliantTypeReference(IVisibilityHelper visibilityHelper)
Converts this type reference to a
JvmTypeReference that can
be used in Java source code. |
LightweightTypeReference |
toJavaType()
Converts types to references that can be expressed as Java type references
in source code.
|
org.eclipse.xtext.common.types.JvmTypeReference |
toTypeReference() |
collectSuperTypes, collectSuperTypes, copyInto, createSubstitutor, expose, findNonNullType, findType, getAllSuperTypes, getAsFunctionTypeReference, getHumanReadableName, getInvariantBoundSubstitute, getLowerBoundSubstitute, getNamedType, getNonInterfaceTypes, getOuter, getOwner, getPrimitiveIfWrapperType, getPrimitiveKind, getPrimitiveKindIfWrapperType, getRawTypes, getServices, getSuperTypes, getTypesFactory, getUniqueIdentifier, getUpperBoundSubstitute, getWrapperTypeIfPrimitive, hasTypeArguments, internalFindTopLevelType, internalIsAssignableFrom, isAssignableFrom, isAssignableFrom, isAssignableFrom, isAssignableFrom, isFunctionType, isSubtypeOf, isSubtypeOf, isUnknown, isValidHint, isWildcard, toJavaCompliantTypeReference, toJavaCompliantTypeReference, toString, tryConvertToArray, tryConvertToFunctionTypeReference, tryConvertToListTypepublic CompoundTypeReference(ITypeReferenceOwner owner, boolean synonym)
public int getKind()
getKind in class LightweightTypeReferencepublic org.eclipse.xtext.common.types.JvmTypeReference toTypeReference()
toTypeReference in class LightweightTypeReferencepublic boolean isVisible(IVisibilityHelper visibilityHelper)
LightweightTypeReferencetrue if this type is fully visible according to the given visibilityHelper.
All components and bounds are taken into account, e.g.
arrays use their component type
and generified types check their type arguments, too.isVisible in class LightweightTypeReferencepublic org.eclipse.xtext.common.types.JvmTypeReference toJavaCompliantTypeReference(IVisibilityHelper visibilityHelper)
JvmTypeReference that can
be used in Java source code.
If this is a multi-type rather than a synonym, the Java compliant
type reference is determined from the common super type of all participating, non-interface types.
If there is no such type or this is a synonym, all the component types are used to compute
the common super type and use that one as the type.toJavaCompliantTypeReference in class LightweightTypeReferencepublic java.util.List<LightweightTypeReference> getTypeArguments()
LightweightTypeReferenceList<String> is String.
? extends List<String>.
Raw types don't carry type arguments. Wildcards with more than one upper bound
don't carry type arguments.getTypeArguments in class LightweightTypeReferencepublic boolean isRawType()
LightweightTypeReferencetrue is this type points to a raw type.
That is, it points to a parameterized type but does not define type arguments or
it points to an external type parameter that has a raw type constraint.
Type parameters that are declared by the current owner are not considered to be raw types.
A type is also a raw type if it inherits from a raw type.isRawType in class LightweightTypeReferencepublic boolean isArray()
isArray in class LightweightTypeReferencepublic LightweightTypeReference getComponentType()
LightweightTypeReferencegetComponentType in class LightweightTypeReferencenull.LightweightTypeReference.isArray()public boolean isAny()
isAny in class LightweightTypeReferencepublic boolean isPrimitive()
isPrimitive in class LightweightTypeReferencepublic boolean isAnonymous()
isAnonymous in class LightweightTypeReferencepublic boolean isWrapper()
isWrapper in class LightweightTypeReferencepublic boolean isPrimitiveVoid()
isPrimitiveVoid in class LightweightTypeReferencepublic FunctionTypeKind getFunctionTypeKind()
getFunctionTypeKind in class LightweightTypeReferencepublic boolean isInterfaceType()
isInterfaceType in class LightweightTypeReferencepublic LightweightTypeReference getRawTypeReference()
getRawTypeReference in class LightweightTypeReferencepublic boolean isOwnedBy(ITypeReferenceOwner owner)
isOwnedBy in class LightweightTypeReferencepublic org.eclipse.xtext.common.types.JvmType getType()
getType in class LightweightTypeReferenceprotected java.util.List<LightweightTypeReference> getSuperTypes(TypeParameterSubstitutor<?> substitutor)
getSuperTypes in class LightweightTypeReferencepublic LightweightTypeReference getSuperType(org.eclipse.xtext.common.types.JvmType rawType)
LightweightTypeReferencegetSuperType in class LightweightTypeReferencerawType - the raw type that should be resolved.public LightweightTypeReference getSuperType(java.lang.Class<?> rawType)
LightweightTypeReferencenull if the raw type
is not a valid super type of this type.getSuperType in class LightweightTypeReferencerawType - the raw type that should be resolved.public boolean isType(java.lang.Class<?> clazz)
LightweightTypeReferenceclazz.
Returns false if this is not exactly the given type, but a sub type, a
super type or a completely unrelated type.isType in class LightweightTypeReferenceprotected LightweightTypeReference doCopyInto(ITypeReferenceOwner owner)
doCopyInto in class LightweightTypeReferencepublic boolean isResolved()
isResolved in class LightweightTypeReferencepublic boolean isSynonym()
isSynonym in class LightweightTypeReferencepublic void addComponent(LightweightTypeReference component)
public java.lang.String getSimpleName()
LightweightTypeReferencegetSimpleName in class LightweightTypeReferencepublic java.lang.String getIdentifier()
LightweightTypeReferencegetIdentifier in class LightweightTypeReferencepublic java.lang.String getUniqueIdentifier()
LightweightTypeReferencegetUniqueIdentifier in class LightweightTypeReferencepublic java.lang.String getJavaIdentifier()
getJavaIdentifier in class LightweightTypeReferencepublic void accept(TypeReferenceVisitor visitor)
accept in class LightweightTypeReferencepublic <Param> void accept(TypeReferenceVisitorWithParameter<Param> visitor, Param param)
accept in class LightweightTypeReferencepublic <Result> Result accept(TypeReferenceVisitorWithResult<Result> visitor)
accept in class LightweightTypeReferencepublic <Param,Result> Result accept(TypeReferenceVisitorWithParameterAndResult<Param,Result> visitor, Param param)
accept in class LightweightTypeReferencepublic boolean isMultiType()
isMultiType in class LightweightTypeReferencepublic LightweightTypeReference toJavaType()
LightweightTypeReferencetoJavaType in class LightweightTypeReferencepublic java.util.List<LightweightTypeReference> getMultiTypeComponents()
getMultiTypeComponents in class LightweightTypeReference