public class EMFTypeSystem extends AbstractTypeSystem
ITypeSystem.NullTypeSystem
Modifier and Type | Field and Description |
---|---|
static com.google.common.base.Function<IInputKey,org.eclipse.emf.ecore.EClassifier> |
EXTRACT_CLASSIFIER
This function can be used to extract EClassifier instances from IInputKey instances.
|
Constructor and Description |
---|
EMFTypeSystem(org.apache.log4j.Logger logger) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<IInputKey> |
addTypeInformation(java.util.Set<IInputKey> types,
IInputKey newType)
Adds a new type descriptor to a collection of type descriptors, and minimizes it.
|
java.util.Set<IInputKey> |
addTypeInformation(java.util.Set<IInputKey> types,
java.util.Set<IInputKey> newTypes) |
IInputKey |
classifierToInputKey(org.eclipse.emf.ecore.EClassifier classifier) |
IInputKey |
extractColumnDescriptor(RelationType type,
int columnIndex)
Extracts the model-specific column type of the given index from a RelationType declaration
|
IInputKey |
extractTypeDescriptor(Type type)
Extracts the model-specific types from a Type declaration.
|
java.util.Set<IInputKey> |
getCompatibleSupertypes(java.util.Set<IInputKey> types)
Returns a set of types that is a common supertype of a set of type parameters
|
java.lang.Class<?> |
getJavaClass(EDataTypeInSlotsKey key) |
java.lang.Class<?> |
getJavaClass(JavaTransitiveInstancesKey javaKey) |
boolean |
hasCommonSubtype(java.util.Set<IInputKey> typeKeys,
java.lang.Iterable<org.eclipse.emf.ecore.EPackage> ePackages) |
boolean |
isConformant(ClassType expectedType,
ClassType actualType) |
boolean |
isConformant(IInputKey expectedType,
IInputKey actualType)
Decides whether the second type is compatible with the first one
|
boolean |
isConformToRelationColumn(IInputKey relationType,
int columnIndex,
IInputKey columnType)
Decides whether the reference can have a selected type at its given column.
|
boolean |
isConformToRelationSource(ReferenceType relationType,
ClassType sourceType) |
boolean |
isConformToRelationTarget(ReferenceType relationType,
ClassType targetType) |
boolean |
isValidType(Type type)
Returns whether the type declaration represents a valid, resolvable type for the selected type system.
|
java.util.Set<IInputKey> |
minimizeTypeInformation(java.util.Set<IInputKey> types,
boolean mergeWithSupertypes)
Reduces the type descriptor set by providing the most specific set of type descriptors inferrable for a selected
types.
|
org.eclipse.xtext.common.types.JvmTypeReference |
toJvmTypeReference(IInputKey type,
org.eclipse.emf.ecore.EObject context)
Creates a type reference for model inference from a selected type.
|
java.lang.String |
typeString(IInputKey type)
Converts a type object to a user-visible description string.
|
getWrapperClassForType, isValidType
public static final com.google.common.base.Function<IInputKey,org.eclipse.emf.ecore.EClassifier> EXTRACT_CLASSIFIER
public IInputKey extractTypeDescriptor(Type type)
ITypeSystem
type
- either the Type
or the RelationType
instancepublic IInputKey classifierToInputKey(org.eclipse.emf.ecore.EClassifier classifier)
public IInputKey extractColumnDescriptor(RelationType type, int columnIndex)
ITypeSystem
public boolean isConformant(IInputKey expectedType, IInputKey actualType)
ITypeSystem
public java.lang.Class<?> getJavaClass(EDataTypeInSlotsKey key)
public java.lang.Class<?> getJavaClass(JavaTransitiveInstancesKey javaKey)
public boolean isConformToRelationColumn(IInputKey relationType, int columnIndex, IInputKey columnType)
ITypeSystem
public boolean isConformToRelationSource(ReferenceType relationType, ClassType sourceType)
public boolean isConformToRelationTarget(ReferenceType relationType, ClassType targetType)
public org.eclipse.xtext.common.types.JvmTypeReference toJvmTypeReference(IInputKey type, org.eclipse.emf.ecore.EObject context)
ITypeSystem
public java.util.Set<IInputKey> minimizeTypeInformation(java.util.Set<IInputKey> types, boolean mergeWithSupertypes)
ITypeSystem
types
- a collection of type definitionsmergeWithSupertypes
- if true, the collection is also minimized by calculating common supertypespublic java.util.Set<IInputKey> addTypeInformation(java.util.Set<IInputKey> types, IInputKey newType)
ITypeSystem
#minimizeTypeInformation(Set)
with types.add(newType)
, but might have a more
efficient impementation.public java.util.Set<IInputKey> addTypeInformation(java.util.Set<IInputKey> types, java.util.Set<IInputKey> newTypes)
public boolean hasCommonSubtype(java.util.Set<IInputKey> typeKeys, java.lang.Iterable<org.eclipse.emf.ecore.EPackage> ePackages)
public java.lang.String typeString(IInputKey type)
ITypeSystem
typeString
in interface ITypeSystem
typeString
in class AbstractTypeSystem
type
- either a Type
, or a model-specific type instancepublic java.util.Set<IInputKey> getCompatibleSupertypes(java.util.Set<IInputKey> types)
ITypeSystem
public boolean isValidType(Type type)
ITypeSystem
isValidType
in interface ITypeSystem
isValidType
in class AbstractTypeSystem