public class FunctionTypeReference extends ParameterizedTypeReference
LightweightTypeReference.IdentifierFunction, LightweightTypeReference.JavaIdentifierFunction, LightweightTypeReference.SimpleNameFunction, LightweightTypeReference.UniqueIdentifierFunction
resolved
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 and Description |
---|
FunctionTypeReference(ITypeReferenceOwner owner,
JvmType type) |
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 |
addParameterType(LightweightTypeReference parameterType) |
protected void |
copyTypeArguments(ParameterizedTypeReference result,
ITypeReferenceOwner owner) |
protected FunctionTypeReference |
doCopyInto(ITypeReferenceOwner owner) |
FunctionTypeReference |
getAsFunctionTypeReference()
Returns the equivalent
FunctionTypeReference if this reference
points to a function or procedure
or if it is already a function type reference. |
protected java.lang.String |
getAsString(java.lang.String type,
com.google.common.base.Function<LightweightTypeReference,java.lang.String> format) |
protected java.lang.String |
getAsStringNoFunctionType(java.lang.String type,
com.google.common.base.Function<LightweightTypeReference,java.lang.String> format) |
protected JvmTypeReference |
getEquivalentTypeReference() |
java.lang.String |
getJavaIdentifier() |
int |
getKind()
Subclasses must override this method.
|
java.util.List<LightweightTypeReference> |
getParameterTypes() |
LightweightTypeReference |
getReturnType() |
boolean |
isOwnedBy(ITypeReferenceOwner owner) |
boolean |
isVisible(IVisibilityHelper visibilityHelper)
Returns
true if this type is fully visible according to the given visibilityHelper . |
void |
setReturnType(LightweightTypeReference returnType) |
JvmTypeReference |
toTypeReference() |
FunctionTypeReference |
tryConvertToFunctionTypeReference(boolean rawType)
Converts this reference to a
FunctionTypeReference if the referenced type is a SAM type. |
addTypeArgument, checkStaticFlag, createRawTypeReference, 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
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
public FunctionTypeReference(ITypeReferenceOwner owner, JvmType type)
public int getKind()
getKind
in class ParameterizedTypeReference
protected FunctionTypeReference doCopyInto(ITypeReferenceOwner owner)
doCopyInto
in class ParameterizedTypeReference
protected void copyTypeArguments(ParameterizedTypeReference result, ITypeReferenceOwner owner)
copyTypeArguments
in class ParameterizedTypeReference
public java.util.List<LightweightTypeReference> getParameterTypes()
public LightweightTypeReference getReturnType()
public boolean isVisible(IVisibilityHelper visibilityHelper)
LightweightTypeReference
true
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 ParameterizedTypeReference
public boolean isOwnedBy(ITypeReferenceOwner owner)
isOwnedBy
in class ParameterizedTypeReference
public JvmTypeReference toTypeReference()
toTypeReference
in class ParameterizedTypeReference
protected JvmTypeReference getEquivalentTypeReference()
public void addParameterType(LightweightTypeReference parameterType)
public void setReturnType(LightweightTypeReference returnType)
protected java.lang.String getAsString(java.lang.String type, com.google.common.base.Function<LightweightTypeReference,java.lang.String> format)
getAsString
in class ParameterizedTypeReference
public java.lang.String getJavaIdentifier()
getJavaIdentifier
in class ParameterizedTypeReference
protected java.lang.String getAsStringNoFunctionType(java.lang.String type, com.google.common.base.Function<LightweightTypeReference,java.lang.String> format)
public void accept(TypeReferenceVisitor visitor)
accept
in class ParameterizedTypeReference
public <Param> void accept(TypeReferenceVisitorWithParameter<Param> visitor, Param param)
accept
in class ParameterizedTypeReference
public <Result> Result accept(TypeReferenceVisitorWithResult<Result> visitor)
accept
in class ParameterizedTypeReference
public <Param,Result> Result accept(TypeReferenceVisitorWithParameterAndResult<Param,Result> visitor, Param param)
accept
in class ParameterizedTypeReference
public FunctionTypeReference tryConvertToFunctionTypeReference(boolean rawType)
ParameterizedTypeReference
FunctionTypeReference
if the referenced type is a SAM type.
Returns null
if this reference does not point to a valid function type.tryConvertToFunctionTypeReference
in class ParameterizedTypeReference
rawType
- if a raw view on the function type is sufficient.FunctionTypes.tryConvertToFunctionTypeReference(ParameterizedTypeReference, boolean)
public FunctionTypeReference getAsFunctionTypeReference()
ParameterizedTypeReference
FunctionTypeReference
if this reference
points to a function
or procedure
or if it is already a function type reference.
Otherwise returns null
.getAsFunctionTypeReference
in class ParameterizedTypeReference
FunctionTypes.getAsFunctionTypeReference(ParameterizedTypeReference)