Class AnyTypeReference
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
-
- org.eclipse.xtext.xbase.typesystem.references.AnyTypeReference
-
public class AnyTypeReference extends LightweightTypeReference
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
LightweightTypeReference.IdentifierFunction, LightweightTypeReference.JavaIdentifierFunction, LightweightTypeReference.SimpleNameFunction, LightweightTypeReference.UniqueIdentifierFunction
-
-
Field Summary
-
Fields inherited from class org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
KIND_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 Summary
Constructors Constructor Description AnyTypeReference(ITypeReferenceOwner owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(TypeReferenceVisitor visitor)
<Param> void
accept(TypeReferenceVisitorWithParameter<Param> visitor, Param param)
<Param,Result>
Resultaccept(TypeReferenceVisitorWithParameterAndResult<Param,Result> visitor, Param param)
<Result> Result
accept(TypeReferenceVisitorWithResult<Result> visitor)
void
collectSuperTypes(SuperTypeAcceptor acceptor)
protected LightweightTypeReference
doCopyInto(ITypeReferenceOwner owner)
java.lang.String
getIdentifier()
Returns the identifier of this type reference.java.lang.String
getJavaIdentifier()
int
getKind()
Subclasses must override this method.java.lang.String
getSimpleName()
Prints the simple name of this type reference.protected java.util.List<LightweightTypeReference>
getSuperTypes(TypeParameterSubstitutor<?> substitutor)
org.eclipse.xtext.common.types.JvmType
getType()
java.lang.String
getUniqueIdentifier()
Returns an identifier that allows to disambiguate type parameter names that have different origins.boolean
isAny()
boolean
isType(java.lang.Class<?> clazz)
Returns true if this type reference represents an type with the given raw typeclazz
.boolean
isVisible(IVisibilityHelper visibilityHelper)
Returnstrue
if this type is fully visible according to the givenvisibilityHelper
.org.eclipse.xtext.common.types.JvmTypeReference
toJavaCompliantTypeReference(IVisibilityHelper visibilityHelper)
Converts this type reference to aJvmTypeReference
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()
-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
collectSuperTypes, copyInto, createSubstitutor, expose, findNonNullType, findType, getAllSuperTypes, getAsFunctionTypeReference, getComponentType, getConstraintSubstitute, getFunctionTypeKind, getHumanReadableName, getInvariantBoundSubstitute, getLowerBoundSubstitute, getMultiTypeComponents, getNamedType, getNonInterfaceTypes, getOuter, getOwner, getPrimitiveIfWrapperType, getPrimitiveKind, getPrimitiveKindIfWrapperType, getRawTypeReference, getRawTypes, getServices, getSuperType, getSuperType, getSuperTypes, getTypeArguments, getTypesFactory, getUniqueIdentifier, getUpperBoundSubstitute, getWrapperTypeIfPrimitive, hasTypeArguments, internalFindTopLevelType, internalIsAssignableFrom, isAnonymous, isArray, isAssignableFrom, isAssignableFrom, isAssignableFrom, isAssignableFrom, isFunctionType, isInterfaceType, isMultiType, isOwnedBy, isPrimitive, isPrimitiveVoid, isRawType, isResolved, isSubtypeOf, isSubtypeOf, isSynonym, isUnknown, isValidHint, isWildcard, isWrapper, toJavaCompliantTypeReference, toJavaCompliantTypeReference, toString, tryConvertToArray, tryConvertToFunctionTypeReference, tryConvertToListType
-
-
-
-
Constructor Detail
-
AnyTypeReference
public AnyTypeReference(ITypeReferenceOwner owner)
-
-
Method Detail
-
getKind
public int getKind()
Subclasses must override this method.- Overrides:
getKind
in classLightweightTypeReference
-
doCopyInto
protected LightweightTypeReference doCopyInto(ITypeReferenceOwner owner)
- Specified by:
doCopyInto
in classLightweightTypeReference
-
toTypeReference
public org.eclipse.xtext.common.types.JvmTypeReference toTypeReference()
- Specified by:
toTypeReference
in classLightweightTypeReference
-
isVisible
public boolean isVisible(IVisibilityHelper visibilityHelper)
Description copied from class:LightweightTypeReference
Returnstrue
if this type is fully visible according to the givenvisibilityHelper
. All components and bounds are taken into account, e.g.arrays
use theircomponent type
andgenerified types
check their type arguments, too.- Specified by:
isVisible
in classLightweightTypeReference
-
toJavaCompliantTypeReference
public org.eclipse.xtext.common.types.JvmTypeReference toJavaCompliantTypeReference(IVisibilityHelper visibilityHelper)
Description copied from class:LightweightTypeReference
Converts this type reference to aJvmTypeReference
that can be used in Java source code.- Specified by:
toJavaCompliantTypeReference
in classLightweightTypeReference
-
isAny
public boolean isAny()
- Overrides:
isAny
in classLightweightTypeReference
-
getSimpleName
public java.lang.String getSimpleName()
Description copied from class:LightweightTypeReference
Prints the simple name of this type reference. Useful for testing.- Specified by:
getSimpleName
in classLightweightTypeReference
-
getIdentifier
public java.lang.String getIdentifier()
Description copied from class:LightweightTypeReference
Returns the identifier of this type reference. Usually the qualified name with a dollar delimiter.- Specified by:
getIdentifier
in classLightweightTypeReference
-
getUniqueIdentifier
public java.lang.String getUniqueIdentifier()
Description copied from class:LightweightTypeReference
Returns an identifier that allows to disambiguate type parameter names that have different origins. Rather than just giving the name of the type parameter, it also prints the declarator.- Specified by:
getUniqueIdentifier
in classLightweightTypeReference
-
getJavaIdentifier
public java.lang.String getJavaIdentifier()
- Specified by:
getJavaIdentifier
in classLightweightTypeReference
-
isType
public boolean isType(java.lang.Class<?> clazz)
Description copied from class:LightweightTypeReference
Returns true if this type reference represents an type with the given raw typeclazz
. Returns false if this is not exactly the given type, but a sub type, a super type or a completely unrelated type.- Specified by:
isType
in classLightweightTypeReference
-
getType
public org.eclipse.xtext.common.types.JvmType getType()
- Specified by:
getType
in classLightweightTypeReference
-
getSuperTypes
protected java.util.List<LightweightTypeReference> getSuperTypes(TypeParameterSubstitutor<?> substitutor)
- Specified by:
getSuperTypes
in classLightweightTypeReference
-
collectSuperTypes
public void collectSuperTypes(SuperTypeAcceptor acceptor)
- Overrides:
collectSuperTypes
in classLightweightTypeReference
-
accept
public void accept(TypeReferenceVisitor visitor)
- Overrides:
accept
in classLightweightTypeReference
-
accept
public <Param> void accept(TypeReferenceVisitorWithParameter<Param> visitor, Param param)
- Overrides:
accept
in classLightweightTypeReference
-
accept
public <Result> Result accept(TypeReferenceVisitorWithResult<Result> visitor)
- Overrides:
accept
in classLightweightTypeReference
-
accept
public <Param,Result> Result accept(TypeReferenceVisitorWithParameterAndResult<Param,Result> visitor, Param param)
- Overrides:
accept
in classLightweightTypeReference
-
toJavaType
public LightweightTypeReference toJavaType()
Description copied from class:LightweightTypeReference
Converts types to references that can be expressed as Java type references in source code. Any types will be expressed as Object whereas multi types will be expressed as their common super type. Unknown types are considered to be ok thus returned as is.- Overrides:
toJavaType
in classLightweightTypeReference
-
-