Class FunctionTypeReference
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
-
- org.eclipse.xtext.xbase.typesystem.references.ParameterizedTypeReference
-
- org.eclipse.xtext.xbase.typesystem.references.FunctionTypeReference
-
- Direct Known Subclasses:
InnerFunctionTypeReference
public class FunctionTypeReference extends ParameterizedTypeReference
-
-
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.ParameterizedTypeReference
resolved
-
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 FunctionTypeReference(ITypeReferenceOwner owner, org.eclipse.xtext.common.types.JvmType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(TypeReferenceVisitor visitor)<Param> voidaccept(TypeReferenceVisitorWithParameter<Param> visitor, Param param)<Param,Result>
Resultaccept(TypeReferenceVisitorWithParameterAndResult<Param,Result> visitor, Param param)<Result> Resultaccept(TypeReferenceVisitorWithResult<Result> visitor)voidaddParameterType(LightweightTypeReference parameterType)protected voidcopyTypeArguments(ParameterizedTypeReference result, ITypeReferenceOwner owner)protected FunctionTypeReferencedoCopyInto(ITypeReferenceOwner owner)FunctionTypeReferencegetAsFunctionTypeReference()Returns the equivalentFunctionTypeReferenceif this reference points to afunctionorprocedureor if it is already a function type reference.protected java.lang.StringgetAsString(java.lang.String type, com.google.common.base.Function<LightweightTypeReference,java.lang.String> format)protected java.lang.StringgetAsStringNoFunctionType(java.lang.String type, com.google.common.base.Function<LightweightTypeReference,java.lang.String> format)protected org.eclipse.xtext.common.types.JvmTypeReferencegetEquivalentTypeReference()java.lang.StringgetJavaIdentifier()intgetKind()Subclasses must override this method.java.util.List<LightweightTypeReference>getParameterTypes()LightweightTypeReferencegetReturnType()booleanisOwnedBy(ITypeReferenceOwner owner)booleanisVisible(IVisibilityHelper visibilityHelper)Returnstrueif this type is fully visible according to the givenvisibilityHelper.voidsetReturnType(LightweightTypeReference returnType)org.eclipse.xtext.common.types.JvmTypeReferencetoTypeReference()FunctionTypeReferencetryConvertToFunctionTypeReference(boolean rawType)Converts this reference to aFunctionTypeReferenceif the referenced type is a SAM type.-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.references.ParameterizedTypeReference
addTypeArgument, checkStaticFlag, createRawTypeReference, getConstraintSubstitute, getFunctionTypeKind, getIdentifier, getPrimitiveIfWrapperType, getPrimitiveKind, getPrimitiveKindIfWrapperType, getRawSuperType, getRawTypeReference, getRawTypes, getSimpleName, getSuperType, getSuperType, getSuperTypes, getType, getTypeArguments, getUniqueIdentifier, getWrapperTypeIfPrimitive, isAnonymous, isInner, isInterfaceType, isPrimitive, isPrimitiveVoid, isRawType, isResolved, isType, isTypeVisible, isWrapper, toInstanceTypeReference, toJavaCompliantTypeReference, tryConvertToArray, tryConvertToListType
-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
collectSuperTypes, collectSuperTypes, copyInto, createSubstitutor, expose, findNonNullType, findType, getAllSuperTypes, getComponentType, getHumanReadableName, getInvariantBoundSubstitute, getLowerBoundSubstitute, getMultiTypeComponents, getNamedType, getNonInterfaceTypes, getOuter, getOwner, getServices, getSuperTypes, getTypesFactory, getUniqueIdentifier, getUpperBoundSubstitute, hasTypeArguments, internalFindTopLevelType, internalIsAssignableFrom, isAny, isArray, isAssignableFrom, isAssignableFrom, isAssignableFrom, isAssignableFrom, isFunctionType, isMultiType, isSubtypeOf, isSubtypeOf, isSynonym, isUnknown, isValidHint, isWildcard, toJavaCompliantTypeReference, toJavaCompliantTypeReference, toJavaType, toString
-
-
-
-
Constructor Detail
-
FunctionTypeReference
public FunctionTypeReference(ITypeReferenceOwner owner, org.eclipse.xtext.common.types.JvmType type)
-
-
Method Detail
-
getKind
public int getKind()
Subclasses must override this method.- Overrides:
getKindin classParameterizedTypeReference
-
doCopyInto
protected FunctionTypeReference doCopyInto(ITypeReferenceOwner owner)
- Overrides:
doCopyIntoin classParameterizedTypeReference
-
copyTypeArguments
protected void copyTypeArguments(ParameterizedTypeReference result, ITypeReferenceOwner owner)
- Overrides:
copyTypeArgumentsin classParameterizedTypeReference
-
getParameterTypes
public java.util.List<LightweightTypeReference> getParameterTypes()
-
getReturnType
public LightweightTypeReference getReturnType()
-
isVisible
public boolean isVisible(IVisibilityHelper visibilityHelper)
Description copied from class:LightweightTypeReferenceReturnstrueif this type is fully visible according to the givenvisibilityHelper. All components and bounds are taken into account, e.g.arraysuse theircomponent typeandgenerified typescheck their type arguments, too.- Overrides:
isVisiblein classParameterizedTypeReference
-
isOwnedBy
public boolean isOwnedBy(ITypeReferenceOwner owner)
- Overrides:
isOwnedByin classParameterizedTypeReference
-
toTypeReference
public org.eclipse.xtext.common.types.JvmTypeReference toTypeReference()
- Overrides:
toTypeReferencein classParameterizedTypeReference
-
getEquivalentTypeReference
protected org.eclipse.xtext.common.types.JvmTypeReference getEquivalentTypeReference()
-
addParameterType
public void addParameterType(LightweightTypeReference parameterType)
-
setReturnType
public void setReturnType(LightweightTypeReference returnType)
-
getAsString
protected java.lang.String getAsString(java.lang.String type, com.google.common.base.Function<LightweightTypeReference,java.lang.String> format)- Overrides:
getAsStringin classParameterizedTypeReference
-
getJavaIdentifier
public java.lang.String getJavaIdentifier()
- Overrides:
getJavaIdentifierin classParameterizedTypeReference
-
getAsStringNoFunctionType
protected java.lang.String getAsStringNoFunctionType(java.lang.String type, com.google.common.base.Function<LightweightTypeReference,java.lang.String> format)
-
accept
public void accept(TypeReferenceVisitor visitor)
- Overrides:
acceptin classParameterizedTypeReference
-
accept
public <Param> void accept(TypeReferenceVisitorWithParameter<Param> visitor, Param param)
- Overrides:
acceptin classParameterizedTypeReference
-
accept
public <Result> Result accept(TypeReferenceVisitorWithResult<Result> visitor)
- Overrides:
acceptin classParameterizedTypeReference
-
accept
public <Param,Result> Result accept(TypeReferenceVisitorWithParameterAndResult<Param,Result> visitor, Param param)
- Overrides:
acceptin classParameterizedTypeReference
-
tryConvertToFunctionTypeReference
public FunctionTypeReference tryConvertToFunctionTypeReference(boolean rawType)
Description copied from class:ParameterizedTypeReferenceConverts this reference to aFunctionTypeReferenceif the referenced type is a SAM type. Returnsnullif this reference does not point to a valid function type.- Overrides:
tryConvertToFunctionTypeReferencein classParameterizedTypeReference- Parameters:
rawType- if a raw view on the function type is sufficient.- See Also:
FunctionTypes.tryConvertToFunctionTypeReference(ParameterizedTypeReference, boolean)
-
getAsFunctionTypeReference
public FunctionTypeReference getAsFunctionTypeReference()
Description copied from class:ParameterizedTypeReferenceReturns the equivalentFunctionTypeReferenceif this reference points to afunctionorprocedureor if it is already a function type reference. Otherwise returnsnull.- Overrides:
getAsFunctionTypeReferencein classParameterizedTypeReference- See Also:
FunctionTypes.getAsFunctionTypeReference(ParameterizedTypeReference)
-
-