public class StandardTypeReferenceOwner extends java.lang.Object implements ITypeReferenceOwner
ITypeReferenceOwner.
It is not capable of handling reference resolution or unbound type argument hints.| Constructor and Description |
|---|
StandardTypeReferenceOwner(CommonTypeComputationServices services,
org.eclipse.emf.ecore.EObject context) |
StandardTypeReferenceOwner(CommonTypeComputationServices services,
org.eclipse.emf.ecore.resource.Resource context) |
StandardTypeReferenceOwner(CommonTypeComputationServices services,
org.eclipse.emf.ecore.resource.ResourceSet context) |
| Modifier and Type | Method and Description |
|---|---|
void |
acceptHint(java.lang.Object handle,
LightweightBoundTypeArgument boundTypeArgument) |
java.util.List<LightweightBoundTypeArgument> |
getAllHints(java.lang.Object handle) |
org.eclipse.emf.ecore.resource.ResourceSet |
getContextResourceSet()
Returns the context resource set if any.
|
java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> |
getDeclaredTypeParameters()
The currently known type parameters, e.g.
|
LightweightTypeReferenceFactory |
getFactory() |
CommonTypeComputationServices |
getServices()
Access to commonly used services for type references.
|
boolean |
isResolved(java.lang.Object handle) |
AnyTypeReference |
newAnyTypeReference()
Creates a new representation of the
any type, e.g. |
ArrayTypeReference |
newArrayTypeReference(LightweightTypeReference componentTypeReference)
Creates a new
ArrayTypeReference with the given component type. |
CompoundTypeReference |
newCompoundTypeReference(boolean synonym)
Creates a new
CompoundTypeReference that is either a synonym
or a multi type reference. |
FunctionTypeReference |
newFunctionTypeReference(org.eclipse.xtext.common.types.JvmType type)
Creates a new
FunctionTypeReference that is backed by the given type. |
InnerFunctionTypeReference |
newFunctionTypeReference(LightweightTypeReference outer,
org.eclipse.xtext.common.types.JvmType type)
Create a new
InnerFunctionTypeReference that is backed by the given type and has to
defined outer type. |
ParameterizedTypeReference |
newParameterizedTypeReference(org.eclipse.xtext.common.types.JvmType type)
Creates a new
ParameterizedTypeReference from the given type. |
InnerTypeReference |
newParameterizedTypeReference(LightweightTypeReference outer,
org.eclipse.xtext.common.types.JvmType type)
Creates a new
InnerTypeReference. |
LightweightTypeReference |
newReferenceTo(java.lang.Class<?> type)
Creates a references to the given class or returns an
UnknownTypeReference if no
JRE is available. |
LightweightTypeReference |
newReferenceTo(java.lang.Class<?> type,
TypeReferenceInitializer<? super ParameterizedTypeReference> init)
Creates a references to the given class or returns an
UnknownTypeReference if no
JRE is available. |
LightweightTypeReference |
newReferenceToObject()
Creates a references to
Object or returns an UnknownTypeReference if no
JRE is available. |
UnknownTypeReference |
newUnknownTypeReference()
Creates a new unnamed
UnknownTypeReference. |
UnknownTypeReference |
newUnknownTypeReference(java.lang.String name)
Creates a new named
UnknownTypeReference. |
WildcardTypeReference |
newWildcardExtendsObject()
Creates a wildcard reference to
Object or returns a wildcard to an UnknownTypeReference if no
JRE is available. |
WildcardTypeReference |
newWildcardTypeReference()
Creates a new
WildcardTypeReference without any upper or lower bounds. |
void |
setFactory(LightweightTypeReferenceFactory factory) |
LightweightTypeReference |
toLightweightTypeReference(org.eclipse.xtext.common.types.JvmType type)
Creates a new type reference that points to the given type.
|
LightweightTypeReference |
toLightweightTypeReference(org.eclipse.xtext.common.types.JvmTypeReference type)
Transforms the given EMF based type reference to its equivalent in the
LightweightTypeReference
hierarchy. |
LightweightTypeReference |
toPlainTypeReference(org.eclipse.xtext.common.types.JvmType type)
Creates a new type reference that points to the given type.
|
public StandardTypeReferenceOwner(CommonTypeComputationServices services, org.eclipse.emf.ecore.resource.ResourceSet context)
public StandardTypeReferenceOwner(CommonTypeComputationServices services, org.eclipse.emf.ecore.EObject context)
public StandardTypeReferenceOwner(CommonTypeComputationServices services, org.eclipse.emf.ecore.resource.Resource context)
public CommonTypeComputationServices getServices()
ITypeReferenceOwnergetServices in interface ITypeReferenceOwnerpublic LightweightTypeReferenceFactory getFactory()
public void setFactory(LightweightTypeReferenceFactory factory)
public org.eclipse.emf.ecore.resource.ResourceSet getContextResourceSet()
getContextResourceSet in interface ITypeReferenceOwnerpublic void acceptHint(java.lang.Object handle,
LightweightBoundTypeArgument boundTypeArgument)
acceptHint in interface ITypeReferenceOwnerjava.lang.UnsupportedOperationException - alwayspublic java.util.List<LightweightBoundTypeArgument> getAllHints(java.lang.Object handle)
getAllHints in interface ITypeReferenceOwnerjava.lang.UnsupportedOperationException - alwayspublic boolean isResolved(java.lang.Object handle)
isResolved in interface ITypeReferenceOwnerjava.lang.UnsupportedOperationException - alwayspublic java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> getDeclaredTypeParameters()
ITypeReferenceOwnergetDeclaredTypeParameters in interface ITypeReferenceOwnerpublic LightweightTypeReference toPlainTypeReference(org.eclipse.xtext.common.types.JvmType type)
ITypeReferenceOwnerJvmArrayType,
an ArrayTypeReference is produced. The produced LightweightTypeReference does not
have any type arguments. It is similar to a raw type reference except for cases where the type
points to a JvmTypeParameter or an array of type parameters. In
those cases, the result is different form toPlainTypeReference(JvmType).
getRawTypeReference().toPlainTypeReference in interface ITypeReferenceOwnertype - the type. May not be null.public LightweightTypeReference toLightweightTypeReference(org.eclipse.xtext.common.types.JvmType type)
ITypeReferenceOwnerJvmArrayType,
an ArrayTypeReference is produced. The produced LightweightTypeReference does have
type arguments if the given type is generic or an array of a generic type. The type arguments point
to the original type parameters.
Useful for later substitution of all type parameters.toLightweightTypeReference in interface ITypeReferenceOwnertype - the raw type. May not be null.public LightweightTypeReference toLightweightTypeReference(org.eclipse.xtext.common.types.JvmTypeReference type)
ITypeReferenceOwnerLightweightTypeReference
hierarchy.toLightweightTypeReference in interface ITypeReferenceOwnertype - the type to convert. May not be null.public CompoundTypeReference newCompoundTypeReference(boolean synonym)
ITypeReferenceOwnerCompoundTypeReference that is either a synonym
or a multi type reference.newCompoundTypeReference in interface ITypeReferenceOwnersynonym - whether it should be a synonym type reference.public WildcardTypeReference newWildcardTypeReference()
ITypeReferenceOwnerWildcardTypeReference without any upper or lower bounds.
Usually clients need to add those to make it a valid type reference.newWildcardTypeReference in interface ITypeReferenceOwnerpublic ArrayTypeReference newArrayTypeReference(LightweightTypeReference componentTypeReference)
ITypeReferenceOwnerArrayTypeReference with the given component type.newArrayTypeReference in interface ITypeReferenceOwnerpublic FunctionTypeReference newFunctionTypeReference(org.eclipse.xtext.common.types.JvmType type)
ITypeReferenceOwnerFunctionTypeReference that is backed by the given type. Constraints apply
as in ITypeReferenceOwner.newParameterizedTypeReference(JvmType).
Clients are responsible to pass a valid SAM type to ITypeReferenceOwner.newFunctionTypeReference(JvmType).newFunctionTypeReference in interface ITypeReferenceOwnertype - the raw function type.public InnerFunctionTypeReference newFunctionTypeReference(LightweightTypeReference outer, org.eclipse.xtext.common.types.JvmType type)
ITypeReferenceOwnerInnerFunctionTypeReference that is backed by the given type and has to
defined outer type. Constraints apply as in ITypeReferenceOwner.newFunctionTypeReference(JvmType) and
ITypeReferenceOwner.newParameterizedTypeReference(LightweightTypeReference, JvmType).newFunctionTypeReference in interface ITypeReferenceOwnerouter - the outer type reference.type - the raw type for the newly produced ParameterizedTypeReferencepublic ParameterizedTypeReference newParameterizedTypeReference(org.eclipse.xtext.common.types.JvmType type)
ITypeReferenceOwnerParameterizedTypeReference from the given type. The type
may either be a JvmTypeParameter, JvmPrimitiveType, JvmDeclaredType
or JvmVoid. Other types are considered invalid and will cause an IllegalArgumentException
to be thrown.
If the type is a non-static nested type, the produced type reference will be an
InnerTypeReference.
The produced type reference does not have any type arguments. If the given type is generic,
the returned type reference is a raw type.newParameterizedTypeReference in interface ITypeReferenceOwnertype - the raw type for the newly produced ParameterizedTypeReferencepublic InnerTypeReference newParameterizedTypeReference(LightweightTypeReference outer, org.eclipse.xtext.common.types.JvmType type)
ITypeReferenceOwnerInnerTypeReference. Constraints apply as with ITypeReferenceOwner.newParameterizedTypeReference(JvmType).
If type does not represent a non-static inner class, an exception is thrown.
This method produces references of the form Outer<OuterParams>.Type.newParameterizedTypeReference in interface ITypeReferenceOwnerouter - the outer type reference.type - the raw type for the newly produced ParameterizedTypeReferencepublic UnknownTypeReference newUnknownTypeReference()
ITypeReferenceOwnerUnknownTypeReference.newUnknownTypeReference in interface ITypeReferenceOwnerpublic UnknownTypeReference newUnknownTypeReference(java.lang.String name)
ITypeReferenceOwnerUnknownTypeReference.newUnknownTypeReference in interface ITypeReferenceOwnerpublic AnyTypeReference newAnyTypeReference()
ITypeReferenceOwnerany type, e.g. the type of the
value null.newAnyTypeReference in interface ITypeReferenceOwnerpublic LightweightTypeReference newReferenceToObject()
Object or returns an UnknownTypeReference if no
JRE is available.newReferenceToObject in interface ITypeReferenceOwnerpublic WildcardTypeReference newWildcardExtendsObject()
Object or returns a wildcard to an UnknownTypeReference if no
JRE is available.newWildcardExtendsObject in interface ITypeReferenceOwnerpublic LightweightTypeReference newReferenceTo(java.lang.Class<?> type)
UnknownTypeReference if no
JRE is available.newReferenceTo in interface ITypeReferenceOwnerpublic LightweightTypeReference newReferenceTo(java.lang.Class<?> type, TypeReferenceInitializer<? super ParameterizedTypeReference> init)
UnknownTypeReference if no
JRE is available. If the type is available, the given acceptor is used to initialize it further.newReferenceTo in interface ITypeReferenceOwner