public abstract class AbstractIdResolver extends java.lang.Object implements IdResolver.IdResolverExtension
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractIdResolver.Id2InstanceVisitor |
IdResolver.IdResolverExtension| Modifier and Type | Field and Description |
|---|---|
protected CompleteEnvironment |
environment |
protected java.util.Map<java.lang.Object,Class> |
key2type |
protected java.util.Map<java.lang.String,Package> |
nsURI2package
Mapping from package URI to corresponding Pivot Package.
|
protected java.util.Map<java.lang.String,Package> |
roots2package
Mapping from root package name to corresponding Pivot Package.
|
protected StandardLibrary |
standardLibrary |
| Constructor and Description |
|---|
AbstractIdResolver(CompleteEnvironment environment) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Package |
addEPackage(org.eclipse.emf.ecore.EPackage ePackage) |
void |
addRoot(org.eclipse.emf.ecore.EObject eObject) |
Package |
basicGetPackage(PackageId packageId) |
java.lang.Object |
boxedValueOf(java.lang.Object unboxedValue) |
java.lang.Object |
boxedValueOf(java.lang.Object unboxedValue,
org.eclipse.emf.ecore.EClassifier eClassifier) |
java.lang.Object |
boxedValueOf(java.lang.Object unboxedValue,
org.eclipse.emf.ecore.ETypedElement eFeature,
TypeId typeId) |
java.lang.Object |
boxedValueOfEnumerator(org.eclipse.emf.common.util.Enumerator unboxedValue) |
BagValue |
createBagOfAll(CollectionTypeId typeId,
java.lang.Iterable<? extends java.lang.Object> unboxedValues) |
BagValue |
createBagOfEach(CollectionTypeId typeId,
java.lang.Object... unboxedValues) |
CollectionValue |
createCollectionOfAll(boolean isOrdered,
boolean isUnique,
TypeId elementTypeId,
java.lang.Iterable<? extends java.lang.Object> unboxedValues)
Creates a new OCL Collection of the specified ordering and uniqueness.
|
CollectionValue |
createCollectionOfAll(CollectionTypeId collectedId,
java.lang.Iterable<?> unboxedValues) |
java.lang.Object |
createInstance(TypeId typeId,
java.lang.String stringValue) |
MapValue |
createMapOfAll(TypeId keyTypeId,
TypeId valueTypeId,
java.util.Map<java.lang.Object,java.lang.Object> unboxedValues) |
OrderedSetValue |
createOrderedSetOfAll(CollectionTypeId typeId,
java.lang.Iterable<? extends java.lang.Object> unboxedValues) |
OrderedSetValue |
createOrderedSetOfEach(CollectionTypeId typeId,
java.lang.Object... unboxedValues) |
SequenceValue |
createSequenceOfAll(CollectionTypeId typeId,
java.lang.Iterable<? extends java.lang.Object> unboxedValues) |
SequenceValue |
createSequenceOfEach(CollectionTypeId typeId,
java.lang.Object... unboxedValues) |
SetValue |
createSetOfAll(CollectionTypeId typeId,
java.lang.Iterable<? extends java.lang.Object> unboxedValues) |
SetValue |
createSetOfEach(CollectionTypeId typeId,
java.lang.Object... unboxedValues) |
void |
dispose() |
java.lang.Object |
ecoreValueOf(java.lang.Class<?> instanceClass,
java.lang.Object value)
Return a value adjusted to Ecore calling conventions.
|
<T> org.eclipse.emf.common.util.EList<T> |
ecoreValueOfAll(java.lang.Class<T> instanceClass,
java.lang.Iterable<? extends java.lang.Object> values) |
org.eclipse.emf.common.util.EList<java.lang.Object> |
ecoreValuesOfAll(java.lang.Class<?> instanceClass,
java.lang.Iterable<java.lang.Object> values)
Deprecated.
no longer used
|
org.eclipse.emf.common.util.EList<java.lang.Object> |
ecoreValuesOfEach(java.lang.Class<?> instanceClass,
java.lang.Object... values)
Deprecated.
no longer used
|
Class |
getClass(TypeId typeId,
java.lang.Object context) |
Class |
getCollectionType(CollectionTypeId typeId) |
Class |
getCollectionType(CollectionTypeId typeId,
boolean isNullFree,
IntegerValue lower,
UnlimitedNaturalValue upper) |
Type |
getDynamicTypeOf(java.lang.Iterable<?> values) |
Type |
getDynamicTypeOf(java.lang.Object... values) |
Class |
getDynamicTypeOf(java.lang.Object value)
Compute the type of value according to its content.
|
CompleteEnvironment |
getEnvironment() |
Class |
getJavaType(java.lang.Class<?> javaClass) |
Class |
getMapType(MapTypeId typeId) |
java.lang.Iterable<Class> |
getModelClassesOf(java.lang.Object value) |
Operation |
getOperation(OperationId operationId) |
Package |
getPackage(PackageId packageId) |
Property |
getProperty(PropertyId propertyId) |
StandardLibrary |
getStandardLibrary() |
Class |
getStaticTypeOf(java.lang.Object value) |
Class |
getStaticTypeOf(java.lang.Object value,
java.lang.Iterable<?> values) |
Class |
getStaticTypeOf(java.lang.Object value,
java.lang.Object... values) |
TypedElement |
getTuplePart(java.lang.String name,
Type type) |
TypedElement |
getTuplePart(java.lang.String name,
TypeId typeId) |
abstract TupleType |
getTupleType(TupleTypeId typeId) |
Type |
getType(TypeId typeId,
java.lang.Object context) |
boolean |
isOrdered(java.lang.Object aCollection) |
boolean |
isUnique(java.lang.Object aCollection) |
boolean |
oclEquals(java.lang.Object thisObject,
java.lang.Object thatObject)
Return true if this Value is equal to thatValue regardless of the prevailing ecore/boxed/unboxed
representation of each input.
|
int |
oclHashCode(java.lang.Object anObject)
Return the hashCode of the boxed value of anObject, thereby ensuring that the same hashCode
is used for ecore, boxed and unboxed representations.
|
protected void |
processCrossReferencedRoots() |
protected void |
processDirectRoots() |
org.eclipse.emf.common.util.Enumerator |
unboxedValueOf(EnumerationLiteralId enumerationLiteralId) |
java.lang.Object |
unboxedValueOf(java.lang.Object boxedValue) |
org.eclipse.emf.common.util.EList<java.lang.Object> |
unboxedValuesOfAll(java.util.Collection<? extends java.lang.Object> boxedValues) |
org.eclipse.emf.common.util.EList<java.lang.Object> |
unboxedValuesOfEach(java.lang.Object... boxedValues) |
Type |
visitClassId(ClassId id) |
Type |
visitCollectedId(CollectionTypeId id) |
Type |
visitCollectionTypeId(CollectionTypeId id) |
Type |
visitDataTypeId(DataTypeId id) |
Enumeration |
visitEnumerationId(EnumerationId id) |
EnumerationLiteral |
visitEnumerationLiteralId(EnumerationLiteralId id) |
Type |
visitInvalidId(OclInvalidTypeId id) |
Type |
visitLambdaTypeId(LambdaTypeId id) |
Type |
visitMapTypeId(MapTypeId id) |
Package |
visitNestedPackageId(NestedPackageId packageId) |
Package |
visitNsURIPackageId(NsURIPackageId id) |
Type |
visitNullId(OclVoidTypeId id) |
Operation |
visitOperationId(OperationId id) |
Type |
visitPrimitiveTypeId(PrimitiveTypeId id) |
Property |
visitPropertyId(PropertyId id) |
Package |
visitRootPackageId(RootPackageId id) |
Type |
visitTemplateableTypeId(TemplateableTypeId id) |
Element |
visitTemplateBinding(TemplateBinding id) |
Element |
visitTemplateParameterId(TemplateParameterId id) |
TypedElement |
visitTuplePartId(TuplePartId id) |
Type |
visitTupleTypeId(TupleTypeId id) |
Type |
visitUnspecifiedId(UnspecifiedId id) |
protected <K,V> V |
weakGet(java.util.Map<K,java.lang.ref.WeakReference<V>> map,
K key)
Return the map.get(key).get() entry if there is one or null if not, removing any stale
entry that may be encountered.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInheritance, getType@NonNull protected final CompleteEnvironment environment
@NonNull protected final StandardLibrary standardLibrary
@NonNull protected final java.util.Map<java.lang.Object,Class> key2type
@NonNull protected final java.util.Map<java.lang.String,Package> nsURI2package
@NonNull protected final java.util.Map<java.lang.String,Package> roots2package
public AbstractIdResolver(@NonNull
CompleteEnvironment environment)
protected abstract Package addEPackage(@NonNull org.eclipse.emf.ecore.EPackage ePackage)
public void addRoot(@NonNull
org.eclipse.emf.ecore.EObject eObject)
addRoot in interface IdResolverpublic Package basicGetPackage(@NonNull PackageId packageId)
basicGetPackage in interface IdResolver.IdResolverExtension@Nullable
public java.lang.Object boxedValueOf(@Nullable
java.lang.Object unboxedValue)
boxedValueOf in interface IdResolver@Nullable
public java.lang.Object boxedValueOf(@NonNull
java.lang.Object unboxedValue,
@Nullable
org.eclipse.emf.ecore.EClassifier eClassifier)
boxedValueOf in interface IdResolver@Nullable
public java.lang.Object boxedValueOf(@NonNull
java.lang.Object unboxedValue,
@NonNull
org.eclipse.emf.ecore.ETypedElement eFeature,
@Nullable
TypeId typeId)
boxedValueOf in interface IdResolver@Nullable
public java.lang.Object boxedValueOfEnumerator(@NonNull
org.eclipse.emf.common.util.Enumerator unboxedValue)
@NonNull public BagValue createBagOfAll(@NonNull CollectionTypeId typeId, @NonNull java.lang.Iterable<? extends java.lang.Object> unboxedValues)
createBagOfAll in interface IdResolver@NonNull public BagValue createBagOfEach(@NonNull CollectionTypeId typeId, @NonNull java.lang.Object... unboxedValues)
createBagOfEach in interface IdResolver@NonNull public CollectionValue createCollectionOfAll(boolean isOrdered, boolean isUnique, @NonNull TypeId elementTypeId, @NonNull java.lang.Iterable<? extends java.lang.Object> unboxedValues)
createCollectionOfAll in interface IdResolverisOrdered - the required collection orderingisUnique - the required collection uniquenessunboxedValues - the required collection contents@NonNull public CollectionValue createCollectionOfAll(@NonNull CollectionTypeId collectedId, @NonNull java.lang.Iterable<?> unboxedValues)
createCollectionOfAll in interface IdResolver@Nullable
public java.lang.Object createInstance(@NonNull
TypeId typeId,
@NonNull
java.lang.String stringValue)
createInstance in interface IdResolver@NonNull public MapValue createMapOfAll(@NonNull TypeId keyTypeId, @NonNull TypeId valueTypeId, @NonNull java.util.Map<java.lang.Object,java.lang.Object> unboxedValues)
createMapOfAll in interface IdResolver@NonNull public OrderedSetValue createOrderedSetOfAll(@NonNull CollectionTypeId typeId, @NonNull java.lang.Iterable<? extends java.lang.Object> unboxedValues)
createOrderedSetOfAll in interface IdResolver@NonNull public OrderedSetValue createOrderedSetOfEach(@NonNull CollectionTypeId typeId, @NonNull java.lang.Object... unboxedValues)
createOrderedSetOfEach in interface IdResolver@NonNull public SequenceValue createSequenceOfAll(@NonNull CollectionTypeId typeId, @NonNull java.lang.Iterable<? extends java.lang.Object> unboxedValues)
createSequenceOfAll in interface IdResolver@NonNull public SequenceValue createSequenceOfEach(@NonNull CollectionTypeId typeId, @NonNull java.lang.Object... unboxedValues)
createSequenceOfEach in interface IdResolver@NonNull public SetValue createSetOfAll(@NonNull CollectionTypeId typeId, @NonNull java.lang.Iterable<? extends java.lang.Object> unboxedValues)
createSetOfAll in interface IdResolver@NonNull public SetValue createSetOfEach(@NonNull CollectionTypeId typeId, @NonNull java.lang.Object... unboxedValues)
createSetOfEach in interface IdResolverpublic void dispose()
dispose in interface IdResolver@Nullable
public java.lang.Object ecoreValueOf(@Nullable
java.lang.Class<?> instanceClass,
@Nullable
java.lang.Object value)
IdResolverA numeric value is adjusted to the precision indicated by instanceClass.
An enumeration literal is converted to an Enumerator.
Collections are converted to EcoreEList.UnmodifiableEList
ecoreValueOf in interface IdResolver@NonNull
public <T> org.eclipse.emf.common.util.EList<T> ecoreValueOfAll(@Nullable
java.lang.Class<T> instanceClass,
@NonNull
java.lang.Iterable<? extends java.lang.Object> values)
ecoreValueOfAll in interface IdResolver.IdResolverExtension@Deprecated
@NonNull
public org.eclipse.emf.common.util.EList<java.lang.Object> ecoreValuesOfAll(@Nullable
java.lang.Class<?> instanceClass,
@NonNull
java.lang.Iterable<java.lang.Object> values)
ecoreValuesOfAll in interface IdResolver@Deprecated
@NonNull
public org.eclipse.emf.common.util.EList<java.lang.Object> ecoreValuesOfEach(@Nullable
java.lang.Class<?> instanceClass,
@NonNull
java.lang.Object... values)
ecoreValuesOfEach in interface IdResolverpublic Class getClass(@NonNull TypeId typeId, @Nullable java.lang.Object context)
getClass in interface IdResolverpublic Class getCollectionType(@NonNull CollectionTypeId typeId)
getCollectionType in interface IdResolverpublic Class getCollectionType(@NonNull CollectionTypeId typeId, boolean isNullFree, @Nullable IntegerValue lower, @Nullable UnlimitedNaturalValue upper)
public Class getDynamicTypeOf(@Nullable java.lang.Object value)
IdResolvergetDynamicTypeOf in interface IdResolver@Nullable public Type getDynamicTypeOf(@NonNull java.lang.Object... values)
getDynamicTypeOf in interface IdResolver@Nullable public Type getDynamicTypeOf(@NonNull java.lang.Iterable<?> values)
getDynamicTypeOf in interface IdResolver@NonNull public CompleteEnvironment getEnvironment()
getEnvironment in interface IdResolverpublic Class getJavaType(@NonNull java.lang.Class<?> javaClass)
getJavaType in interface IdResolverpublic Class getMapType(@NonNull MapTypeId typeId)
getMapType in interface IdResolver@Nullable public java.lang.Iterable<Class> getModelClassesOf(@NonNull java.lang.Object value)
getModelClassesOf in interface IdResolver.IdResolverExtension@NonNull public Operation getOperation(@NonNull OperationId operationId)
getOperation in interface IdResolverpublic Package getPackage(@NonNull PackageId packageId)
getPackage in interface IdResolver@NonNull public Property getProperty(@NonNull PropertyId propertyId)
getProperty in interface IdResolver@NonNull public StandardLibrary getStandardLibrary()
getStandardLibrary in interface IdResolverpublic Class getStaticTypeOf(@Nullable java.lang.Object value)
getStaticTypeOf in interface IdResolverpublic Class getStaticTypeOf(@Nullable java.lang.Object value, java.lang.Object... values)
getStaticTypeOf in interface IdResolverpublic Class getStaticTypeOf(@Nullable java.lang.Object value, @NonNull java.lang.Iterable<?> values)
getStaticTypeOf in interface IdResolver@NonNull public TypedElement getTuplePart(@NonNull java.lang.String name, @NonNull TypeId typeId)
getTuplePart in interface IdResolver@NonNull public TypedElement getTuplePart(@NonNull java.lang.String name, @NonNull Type type)
@NonNull public abstract TupleType getTupleType(@NonNull TupleTypeId typeId)
getTupleType in interface IdResolver@NonNull public Type getType(@NonNull TypeId typeId, @Nullable java.lang.Object context)
getType in interface IdResolverpublic boolean isOrdered(@NonNull
java.lang.Object aCollection)
public boolean isUnique(@NonNull
java.lang.Object aCollection)
public boolean oclEquals(@Nullable
java.lang.Object thisObject,
@Nullable
java.lang.Object thatObject)
oclEquals in interface IdResolverpublic int oclHashCode(@Nullable
java.lang.Object anObject)
oclHashCode in interface IdResolver.IdResolverExtensionprotected void processCrossReferencedRoots()
protected void processDirectRoots()
@Nullable
public java.lang.Object unboxedValueOf(@Nullable
java.lang.Object boxedValue)
unboxedValueOf in interface IdResolver@NonNull
public org.eclipse.emf.common.util.Enumerator unboxedValueOf(@NonNull
EnumerationLiteralId enumerationLiteralId)
unboxedValueOf in interface IdResolver@NonNull
public org.eclipse.emf.common.util.EList<java.lang.Object> unboxedValuesOfAll(@NonNull
java.util.Collection<? extends java.lang.Object> boxedValues)
unboxedValuesOfAll in interface IdResolver@NonNull
public org.eclipse.emf.common.util.EList<java.lang.Object> unboxedValuesOfEach(@Nullable
java.lang.Object... boxedValues)
unboxedValuesOfEach in interface IdResolver@NonNull public Type visitClassId(@NonNull ClassId id)
visitClassId in interface IdVisitor<Element>@NonNull public Type visitCollectedId(@NonNull CollectionTypeId id)
@NonNull public Type visitCollectionTypeId(@NonNull CollectionTypeId id)
visitCollectionTypeId in interface IdVisitor<Element>@NonNull public Type visitDataTypeId(@NonNull DataTypeId id)
visitDataTypeId in interface IdVisitor<Element>@NonNull public Enumeration visitEnumerationId(@NonNull EnumerationId id)
visitEnumerationId in interface IdVisitor<Element>@NonNull public EnumerationLiteral visitEnumerationLiteralId(@NonNull EnumerationLiteralId id)
visitEnumerationLiteralId in interface IdVisitor<Element>@NonNull public Type visitInvalidId(@NonNull OclInvalidTypeId id)
visitInvalidId in interface IdVisitor<Element>@NonNull public Type visitLambdaTypeId(@NonNull LambdaTypeId id)
visitLambdaTypeId in interface IdVisitor<Element>@NonNull public Type visitMapTypeId(@NonNull MapTypeId id)
visitMapTypeId in interface IdVisitor<Element>public Package visitNestedPackageId(@NonNull NestedPackageId packageId)
visitNestedPackageId in interface IdVisitor<Element>public Package visitNsURIPackageId(@NonNull NsURIPackageId id)
visitNsURIPackageId in interface IdVisitor<Element>@NonNull public Type visitNullId(@NonNull OclVoidTypeId id)
visitNullId in interface IdVisitor<Element>@NonNull public Operation visitOperationId(@NonNull OperationId id)
visitOperationId in interface IdVisitor<Element>@NonNull public Type visitPrimitiveTypeId(@NonNull PrimitiveTypeId id)
visitPrimitiveTypeId in interface IdVisitor<Element>@NonNull public Property visitPropertyId(@NonNull PropertyId id)
visitPropertyId in interface IdVisitor<Element>public Package visitRootPackageId(@NonNull RootPackageId id)
visitRootPackageId in interface IdVisitor<Element>@NonNull public Element visitTemplateBinding(@NonNull TemplateBinding id)
visitTemplateBinding in interface IdVisitor<Element>@NonNull public Element visitTemplateParameterId(@NonNull TemplateParameterId id)
visitTemplateParameterId in interface IdVisitor<Element>@NonNull public Type visitTemplateableTypeId(@NonNull TemplateableTypeId id)
visitTemplateableTypeId in interface IdVisitor<Element>@NonNull public TypedElement visitTuplePartId(@NonNull TuplePartId id)
visitTuplePartId in interface IdVisitor<Element>@NonNull public Type visitTupleTypeId(@NonNull TupleTypeId id)
visitTupleTypeId in interface IdVisitor<Element>@NonNull public Type visitUnspecifiedId(@NonNull UnspecifiedId id)
visitUnspecifiedId in interface IdVisitor<Element>@Nullable
protected <K,V> V weakGet(@NonNull
java.util.Map<K,java.lang.ref.WeakReference<V>> map,
@NonNull
K key)