org.eclipse.xtext.common.types.util
Class TypeReferences
java.lang.Object
org.eclipse.xtext.common.types.util.TypeReferences
public class TypeReferences
- extends java.lang.Object
- Author:
- Sven Efftinge - Initial contribution and API
Method Summary |
JvmAnyTypeReference |
createAnyTypeReference(org.eclipse.emf.common.notify.Notifier context)
|
JvmGenericArrayTypeReference |
createArrayType(JvmTypeReference componentType)
|
JvmDelegateTypeReference |
createDelegateTypeReference(JvmTypeReference typeRef)
|
JvmMultiTypeReference |
createMultiTypeReference(org.eclipse.emf.common.notify.Notifier context,
JvmTypeReference... references)
|
JvmParameterizedTypeReference |
createTypeRef(JvmType type,
JvmTypeReference... typeArgs)
|
JvmType |
findDeclaredType(java.lang.Class<?> clazz,
org.eclipse.emf.common.notify.Notifier context)
looks up a JVMType corresponding to the given Class . |
JvmType |
findDeclaredType(java.lang.String typeName,
org.eclipse.emf.common.notify.Notifier context)
looks up a JVMType corresponding to the given Class . |
JvmTypeReference |
getArgument(JvmTypeReference left,
int index)
|
JvmTypeReference |
getTypeForName(java.lang.Class<?> clazz,
org.eclipse.emf.common.notify.Notifier context,
JvmTypeReference... params)
|
JvmTypeReference |
getTypeForName(java.lang.String typeName,
org.eclipse.emf.common.notify.Notifier context,
JvmTypeReference... params)
|
boolean |
is(JvmType type,
java.lang.Class<?> clazz)
|
boolean |
is(JvmTypeReference reference,
java.lang.Class<?> clazz)
|
boolean |
isArray(JvmTypeReference type)
|
boolean |
isInstanceOf(JvmTypeReference reference,
java.lang.Class<?> clazz)
|
boolean |
isNullOrProxy(JvmTypeReference reference)
|
protected org.eclipse.emf.common.util.URI |
toCommonTypesUri(java.lang.Class<?> clazz)
|
JvmWildcardTypeReference |
wildCard()
|
JvmWildcardTypeReference |
wildCardExtends(JvmTypeReference clone)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TypeReferences
public TypeReferences()
createAnyTypeReference
public JvmAnyTypeReference createAnyTypeReference(org.eclipse.emf.common.notify.Notifier context)
- Returns:
- a fresh
JvmAnyTypeReference
or null if Object
is not on the context's classpath
createMultiTypeReference
public JvmMultiTypeReference createMultiTypeReference(org.eclipse.emf.common.notify.Notifier context,
JvmTypeReference... references)
- Returns:
- a fresh
JvmMultiTypeReference
pointing to the given references or null if Object
is not
on the context's class path
createTypeRef
public JvmParameterizedTypeReference createTypeRef(JvmType type,
JvmTypeReference... typeArgs)
- Returns:
- a fresh
JvmParameterizedTypeReference
for the given JvmType
parameterized with the given
typeArgs. This method does not check whether the given type can handle the given type arguments.
createDelegateTypeReference
public JvmDelegateTypeReference createDelegateTypeReference(JvmTypeReference typeRef)
getArgument
public JvmTypeReference getArgument(JvmTypeReference left,
int index)
wildCard
public JvmWildcardTypeReference wildCard()
wildCardExtends
public JvmWildcardTypeReference wildCardExtends(JvmTypeReference clone)
toCommonTypesUri
protected org.eclipse.emf.common.util.URI toCommonTypesUri(java.lang.Class<?> clazz)
getTypeForName
public JvmTypeReference getTypeForName(java.lang.Class<?> clazz,
org.eclipse.emf.common.notify.Notifier context,
JvmTypeReference... params)
getTypeForName
public JvmTypeReference getTypeForName(java.lang.String typeName,
org.eclipse.emf.common.notify.Notifier context,
JvmTypeReference... params)
createArrayType
public JvmGenericArrayTypeReference createArrayType(JvmTypeReference componentType)
findDeclaredType
public JvmType findDeclaredType(java.lang.Class<?> clazz,
org.eclipse.emf.common.notify.Notifier context)
- looks up a JVMType corresponding to the given
Class
. This method ignores any Jvm types created in non-
TypeResource
in the given EObject's resourceSet, but goes straight to the Java-layer, using a
IJvmTypeProvider
.
- Returns:
- the JvmType with the same qualified name as the given
Class
object, or null if no such JvmType
could be found using the context's resourceSet.
findDeclaredType
public JvmType findDeclaredType(java.lang.String typeName,
org.eclipse.emf.common.notify.Notifier context)
- looks up a JVMType corresponding to the given
Class
. This method ignores any Jvm types created in non-
TypeResource
in the given context's resourceSet, but goes straight to the Java-layer, using a
IJvmTypeProvider
.
- Returns:
- the JvmType with the same qualified name as the given
Class
object, or null if no such JvmType
could be found using the context's resourceSet.
is
public boolean is(JvmTypeReference reference,
java.lang.Class<?> clazz)
is
public boolean is(JvmType type,
java.lang.Class<?> clazz)
isNullOrProxy
public boolean isNullOrProxy(JvmTypeReference reference)
isInstanceOf
public boolean isInstanceOf(JvmTypeReference reference,
java.lang.Class<?> clazz)
isArray
public boolean isArray(JvmTypeReference type)