public class EMFTypeSystem extends AbstractTypeSystem
| 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) |
Type |
convertToVQLType(org.eclipse.emf.ecore.EObject context,
IInputKey key,
boolean avoidDataTypes)
Returns a new Type instance that represents the same type as the parameter input key.
|
static org.eclipse.emf.ecore.EClassifier |
extractClassifierFromInputKey(IInputKey key)
This function can be used to extract EClassifier instances from IInputKey instances.
|
static org.eclipse.emf.ecore.EClassifier |
extractClassifierFromType(Type typeDeclaration)
This function can be used to extract EClassifier instances from Type declaration.
|
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) |
java.lang.String |
getJavaClassName(EDataTypeInSlotsKey key) |
boolean |
hasCommonSubtype(java.util.Set<IInputKey> typeKeys,
java.lang.Iterable<org.eclipse.emf.ecore.EPackage> ePackages) |
java.util.Optional<org.eclipse.emf.ecore.EClassifier> |
inputKeyToClassifier(IInputKey key)
Returns the EClassifier stored in the IInputKey.
|
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, getWrapperClassNameForTypeName, isValidTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertToVQLTypepublic static org.eclipse.emf.ecore.EClassifier extractClassifierFromInputKey(IInputKey key)
public static org.eclipse.emf.ecore.EClassifier extractClassifierFromType(Type typeDeclaration)
public IInputKey extractTypeDescriptor(Type type)
ITypeSystemtype - either the Type or the RelationType instancepublic Type convertToVQLType(org.eclipse.emf.ecore.EObject context, IInputKey key, boolean avoidDataTypes)
ITypeSystemIllegalArgumentException will be thrown.avoidDataTypes - If set to true, data type are returned as Java typespublic IInputKey classifierToInputKey(org.eclipse.emf.ecore.EClassifier classifier)
public java.util.Optional<org.eclipse.emf.ecore.EClassifier> inputKeyToClassifier(IInputKey key)
public IInputKey extractColumnDescriptor(RelationType type, int columnIndex)
ITypeSystempublic boolean isConformant(IInputKey expectedType, IInputKey actualType)
ITypeSystempublic java.lang.Class<?> getJavaClass(EDataTypeInSlotsKey key)
public java.lang.String getJavaClassName(EDataTypeInSlotsKey key)
public java.lang.Class<?> getJavaClass(JavaTransitiveInstancesKey javaKey)
public boolean isConformToRelationColumn(IInputKey relationType, int columnIndex, IInputKey columnType)
ITypeSystempublic 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)
ITypeSystempublic java.util.Set<IInputKey> minimizeTypeInformation(java.util.Set<IInputKey> types, boolean mergeWithSupertypes)
ITypeSystemtypes - 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)
ITypeSystemtypeString in interface ITypeSystemtypeString in class AbstractTypeSystemtype - either a Type, or a model-specific type instancepublic java.util.Set<IInputKey> getCompatibleSupertypes(java.util.Set<IInputKey> types)
ITypeSystempublic boolean isValidType(Type type)
ITypeSystemisValidType in interface ITypeSystemisValidType in class AbstractTypeSystem