org.eclipse.ocl.examples.library.executor
Class AbstractIdResolver

java.lang.Object
  extended by org.eclipse.ocl.examples.library.executor.AbstractIdResolver
All Implemented Interfaces:
IdVisitor<DomainElement>, IdResolver
Direct Known Subclasses:
EcoreIdResolver, PivotIdResolver

public abstract class AbstractIdResolver
extends java.lang.Object
implements IdResolver


Nested Class Summary
static class AbstractIdResolver.Id2InstanceVisitor
           
 
Field Summary
protected  DomainStandardLibrary standardLibrary
           
 
Constructor Summary
AbstractIdResolver(DomainStandardLibrary standardLibrary)
           
 
Method Summary
 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)
           
 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()
           
 DomainType getCollectionType(CollectionTypeId typeId)
           
 DomainType getCollectionType(CollectionTypeId typeId, IntegerValue lower, IntegerValue upper)
           
 DomainType getDynamicTypeOf(java.lang.Iterable<?> values)
           
 DomainType getDynamicTypeOf(java.lang.Object... values)
           
 DomainType getDynamicTypeOf(java.lang.Object value)
           
 DomainType getJavaType(java.lang.Class<?> javaClass)
           
 DomainType getMetaclass(MetaclassId metaclassId)
           
 DomainOperation getOperation(OperationId operationId)
           
 DomainProperty getProperty(PropertyId propertyId)
           
 DomainStandardLibrary getStandardLibrary()
           
 DomainType getStaticTypeOf(java.lang.Object value)
           
 DomainType getStaticTypeOf(java.lang.Object value, java.lang.Iterable<?> values)
           
 DomainType getStaticTypeOf(java.lang.Object value, java.lang.Object... values)
           
 DomainTypedElement getTuplePart(java.lang.String name, DomainType type)
           
 DomainTypedElement getTuplePart(java.lang.String name, TypeId typeId)
           
abstract  DomainTupleType getTupleType(TupleTypeId typeId)
           
abstract  DomainType getType(org.eclipse.emf.ecore.EClassifier eClassifier)
           
 DomainType getType(TypeId typeId, java.lang.Object context)
           
 boolean oclEquals(java.lang.Object thisValue, java.lang.Object thatValue)
           
 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)
           
 DomainType visitClassId(ClassId id)
           
 DomainType visitCollectedId(CollectionTypeId id)
           
 DomainType visitCollectionTypeId(CollectionTypeId id)
           
 DomainType visitDataTypeId(DataTypeId id)
           
 DomainEnumeration visitEnumerationId(EnumerationId id)
           
 DomainEnumerationLiteral visitEnumerationLiteralId(EnumerationLiteralId id)
           
 DomainType visitInvalidId(OclInvalidTypeId id)
           
 DomainType visitLambdaTypeId(LambdaTypeId id)
           
 DomainType visitMetaclassId(MetaclassId id)
           
 DomainPackage visitNestedPackageId(NestedPackageId packageId)
           
 DomainPackage visitNsURIPackageId(NsURIPackageId id)
           
 DomainType visitNullId(OclVoidTypeId id)
           
 DomainOperation visitOperationId(OperationId id)
           
 DomainType visitPrimitiveTypeId(PrimitiveTypeId id)
           
 DomainProperty visitPropertyId(PropertyId id)
           
 DomainPackage visitRootPackageId(RootPackageId id)
           
 DomainType visitTemplateableTypeId(TemplateableTypeId id)
           
 DomainElement visitTemplateBinding(TemplateBinding id)
           
 DomainElement visitTemplateParameterId(TemplateParameterId id)
           
 DomainTypedElement visitTuplePartId(TuplePartId id)
           
 DomainType visitTupleTypeId(TupleTypeId id)
           
 DomainType 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

standardLibrary

@NonNull
protected final DomainStandardLibrary standardLibrary
Constructor Detail

AbstractIdResolver

public AbstractIdResolver(@NonNull
                          DomainStandardLibrary standardLibrary)
Method Detail

boxedValueOf

@Nullable
public java.lang.Object boxedValueOf(@Nullable
                                              java.lang.Object unboxedValue)
Specified by:
boxedValueOf in interface IdResolver

boxedValueOf

@Nullable
public java.lang.Object boxedValueOf(@NonNull
                                              java.lang.Object unboxedValue,
                                              @Nullable
                                              org.eclipse.emf.ecore.EClassifier eClassifier)
Specified by:
boxedValueOf in interface IdResolver

boxedValueOf

@Nullable
public java.lang.Object boxedValueOf(@NonNull
                                              java.lang.Object unboxedValue,
                                              @NonNull
                                              org.eclipse.emf.ecore.ETypedElement eFeature,
                                              @Nullable
                                              TypeId typeId)
Specified by:
boxedValueOf in interface IdResolver

boxedValueOfEnumerator

@Nullable
public java.lang.Object boxedValueOfEnumerator(@NonNull
                                                        org.eclipse.emf.common.util.Enumerator unboxedValue)

createBagOfAll

@NonNull
public BagValue createBagOfAll(@NonNull
                                       CollectionTypeId typeId,
                                       @NonNull
                                       java.lang.Iterable<? extends java.lang.Object> unboxedValues)
Specified by:
createBagOfAll in interface IdResolver

createBagOfEach

@NonNull
public BagValue createBagOfEach(@NonNull
                                        CollectionTypeId typeId,
                                        @NonNull
                                        java.lang.Object... unboxedValues)
Specified by:
createBagOfEach in interface IdResolver

createCollectionOfAll

@NonNull
public CollectionValue createCollectionOfAll(boolean isOrdered,
                                                     boolean isUnique,
                                                     @NonNull
                                                     TypeId elementTypeId,
                                                     @NonNull
                                                     java.lang.Iterable<? extends java.lang.Object> unboxedValues)
Creates a new OCL Collection of the specified ordering and uniqueness.

Specified by:
createCollectionOfAll in interface IdResolver
Parameters:
isOrdered - the required collection ordering
isUnique - the required collection uniqueness
unboxedValues - the required collection contents
Returns:
the new collection

createCollectionOfAll

@NonNull
public CollectionValue createCollectionOfAll(@NonNull
                                                     CollectionTypeId collectedId,
                                                     @NonNull
                                                     java.lang.Iterable<?> unboxedValues)
Specified by:
createCollectionOfAll in interface IdResolver

createInstance

@Nullable
public java.lang.Object createInstance(@NonNull
                                                TypeId typeId,
                                                @NonNull
                                                java.lang.String stringValue)
Specified by:
createInstance in interface IdResolver

createOrderedSetOfAll

@NonNull
public OrderedSetValue createOrderedSetOfAll(@NonNull
                                                     CollectionTypeId typeId,
                                                     @NonNull
                                                     java.lang.Iterable<? extends java.lang.Object> unboxedValues)
Specified by:
createOrderedSetOfAll in interface IdResolver

createOrderedSetOfEach

@NonNull
public OrderedSetValue createOrderedSetOfEach(@NonNull
                                                      CollectionTypeId typeId,
                                                      @NonNull
                                                      java.lang.Object... unboxedValues)
Specified by:
createOrderedSetOfEach in interface IdResolver

createSequenceOfAll

@NonNull
public SequenceValue createSequenceOfAll(@NonNull
                                                 CollectionTypeId typeId,
                                                 @NonNull
                                                 java.lang.Iterable<? extends java.lang.Object> unboxedValues)
Specified by:
createSequenceOfAll in interface IdResolver

createSequenceOfEach

@NonNull
public SequenceValue createSequenceOfEach(@NonNull
                                                  CollectionTypeId typeId,
                                                  @NonNull
                                                  java.lang.Object... unboxedValues)
Specified by:
createSequenceOfEach in interface IdResolver

createSetOfAll

@NonNull
public SetValue createSetOfAll(@NonNull
                                       CollectionTypeId typeId,
                                       @NonNull
                                       java.lang.Iterable<? extends java.lang.Object> unboxedValues)
Specified by:
createSetOfAll in interface IdResolver

createSetOfEach

@NonNull
public SetValue createSetOfEach(@NonNull
                                        CollectionTypeId typeId,
                                        @NonNull
                                        java.lang.Object... unboxedValues)
Specified by:
createSetOfEach in interface IdResolver

dispose

public void dispose()
Specified by:
dispose in interface IdResolver

getCollectionType

@NonNull
public DomainType getCollectionType(@NonNull
                                            CollectionTypeId typeId)
Specified by:
getCollectionType in interface IdResolver

getCollectionType

@NonNull
public DomainType getCollectionType(@NonNull
                                            CollectionTypeId typeId,
                                            @Nullable
                                            IntegerValue lower,
                                            @Nullable
                                            IntegerValue upper)

getDynamicTypeOf

@NonNull
public DomainType getDynamicTypeOf(@Nullable
                                           java.lang.Object value)
Specified by:
getDynamicTypeOf in interface IdResolver

getDynamicTypeOf

@Nullable
public DomainType getDynamicTypeOf(@NonNull
                                            java.lang.Object... values)
Specified by:
getDynamicTypeOf in interface IdResolver

getDynamicTypeOf

@Nullable
public DomainType getDynamicTypeOf(@NonNull
                                            java.lang.Iterable<?> values)
Specified by:
getDynamicTypeOf in interface IdResolver

getJavaType

@NonNull
public DomainType getJavaType(@NonNull
                                      java.lang.Class<?> javaClass)
Specified by:
getJavaType in interface IdResolver

getMetaclass

@NonNull
public DomainType getMetaclass(@NonNull
                                       MetaclassId metaclassId)
Specified by:
getMetaclass in interface IdResolver

getOperation

@NonNull
public DomainOperation getOperation(@NonNull
                                            OperationId operationId)
Specified by:
getOperation in interface IdResolver

getProperty

@NonNull
public DomainProperty getProperty(@NonNull
                                          PropertyId propertyId)
Specified by:
getProperty in interface IdResolver

getStandardLibrary

@NonNull
public DomainStandardLibrary getStandardLibrary()
Specified by:
getStandardLibrary in interface IdResolver

getStaticTypeOf

@NonNull
public DomainType getStaticTypeOf(@Nullable
                                          java.lang.Object value)
Specified by:
getStaticTypeOf in interface IdResolver

getStaticTypeOf

@NonNull
public DomainType getStaticTypeOf(@Nullable
                                          java.lang.Object value,
                                          java.lang.Object... values)
Specified by:
getStaticTypeOf in interface IdResolver

getStaticTypeOf

@NonNull
public DomainType getStaticTypeOf(@Nullable
                                          java.lang.Object value,
                                          @NonNull
                                          java.lang.Iterable<?> values)
Specified by:
getStaticTypeOf in interface IdResolver

getTuplePart

@NonNull
public DomainTypedElement getTuplePart(@NonNull
                                               java.lang.String name,
                                               @NonNull
                                               TypeId typeId)
Specified by:
getTuplePart in interface IdResolver

getTuplePart

@NonNull
public DomainTypedElement getTuplePart(@NonNull
                                               java.lang.String name,
                                               @NonNull
                                               DomainType type)

getTupleType

@NonNull
public abstract DomainTupleType getTupleType(@NonNull
                                                     TupleTypeId typeId)
Specified by:
getTupleType in interface IdResolver

getType

@NonNull
public abstract DomainType getType(@NonNull
                                           org.eclipse.emf.ecore.EClassifier eClassifier)
Specified by:
getType in interface IdResolver

getType

@NonNull
public DomainType getType(@NonNull
                                  TypeId typeId,
                                  @Nullable
                                  java.lang.Object context)
Specified by:
getType in interface IdResolver

oclEquals

public boolean oclEquals(@Nullable
                         java.lang.Object thisValue,
                         @Nullable
                         java.lang.Object thatValue)
Specified by:
oclEquals in interface IdResolver

unboxedValueOf

@Nullable
public java.lang.Object unboxedValueOf(@Nullable
                                                java.lang.Object boxedValue)
Specified by:
unboxedValueOf in interface IdResolver

unboxedValueOf

@NonNull
public org.eclipse.emf.common.util.Enumerator unboxedValueOf(@NonNull
                                                                     EnumerationLiteralId enumerationLiteralId)
Specified by:
unboxedValueOf in interface IdResolver

unboxedValuesOfAll

@NonNull
public org.eclipse.emf.common.util.EList<java.lang.Object> unboxedValuesOfAll(@NonNull
                                                                                      java.util.Collection<? extends java.lang.Object> boxedValues)
Specified by:
unboxedValuesOfAll in interface IdResolver

unboxedValuesOfEach

@NonNull
public org.eclipse.emf.common.util.EList<java.lang.Object> unboxedValuesOfEach(@NonNull
                                                                                       java.lang.Object... boxedValues)
Specified by:
unboxedValuesOfEach in interface IdResolver

visitClassId

@NonNull
public DomainType visitClassId(@NonNull
                                       ClassId id)
Specified by:
visitClassId in interface IdVisitor<DomainElement>

visitCollectedId

@NonNull
public DomainType visitCollectedId(@NonNull
                                           CollectionTypeId id)

visitCollectionTypeId

@NonNull
public DomainType visitCollectionTypeId(@NonNull
                                                CollectionTypeId id)
Specified by:
visitCollectionTypeId in interface IdVisitor<DomainElement>

visitDataTypeId

@NonNull
public DomainType visitDataTypeId(@NonNull
                                          DataTypeId id)
Specified by:
visitDataTypeId in interface IdVisitor<DomainElement>

visitEnumerationId

@NonNull
public DomainEnumeration visitEnumerationId(@NonNull
                                                    EnumerationId id)
Specified by:
visitEnumerationId in interface IdVisitor<DomainElement>

visitEnumerationLiteralId

@NonNull
public DomainEnumerationLiteral visitEnumerationLiteralId(@NonNull
                                                                  EnumerationLiteralId id)
Specified by:
visitEnumerationLiteralId in interface IdVisitor<DomainElement>

visitInvalidId

@NonNull
public DomainType visitInvalidId(@NonNull
                                         OclInvalidTypeId id)
Specified by:
visitInvalidId in interface IdVisitor<DomainElement>

visitLambdaTypeId

@NonNull
public DomainType visitLambdaTypeId(@NonNull
                                            LambdaTypeId id)
Specified by:
visitLambdaTypeId in interface IdVisitor<DomainElement>

visitMetaclassId

@NonNull
public DomainType visitMetaclassId(@NonNull
                                           MetaclassId id)
Specified by:
visitMetaclassId in interface IdVisitor<DomainElement>

visitNestedPackageId

@NonNull
public DomainPackage visitNestedPackageId(@NonNull
                                                  NestedPackageId packageId)
Specified by:
visitNestedPackageId in interface IdVisitor<DomainElement>

visitNsURIPackageId

@NonNull
public DomainPackage visitNsURIPackageId(@NonNull
                                                 NsURIPackageId id)
Specified by:
visitNsURIPackageId in interface IdVisitor<DomainElement>

visitNullId

@NonNull
public DomainType visitNullId(@NonNull
                                      OclVoidTypeId id)
Specified by:
visitNullId in interface IdVisitor<DomainElement>

visitOperationId

@NonNull
public DomainOperation visitOperationId(@NonNull
                                                OperationId id)
Specified by:
visitOperationId in interface IdVisitor<DomainElement>

visitPrimitiveTypeId

@NonNull
public DomainType visitPrimitiveTypeId(@NonNull
                                               PrimitiveTypeId id)
Specified by:
visitPrimitiveTypeId in interface IdVisitor<DomainElement>

visitPropertyId

@NonNull
public DomainProperty visitPropertyId(@NonNull
                                              PropertyId id)
Specified by:
visitPropertyId in interface IdVisitor<DomainElement>

visitRootPackageId

@NonNull
public DomainPackage visitRootPackageId(@NonNull
                                                RootPackageId id)
Specified by:
visitRootPackageId in interface IdVisitor<DomainElement>

visitTemplateBinding

@NonNull
public DomainElement visitTemplateBinding(@NonNull
                                                  TemplateBinding id)
Specified by:
visitTemplateBinding in interface IdVisitor<DomainElement>

visitTemplateParameterId

@NonNull
public DomainElement visitTemplateParameterId(@NonNull
                                                      TemplateParameterId id)
Specified by:
visitTemplateParameterId in interface IdVisitor<DomainElement>

visitTemplateableTypeId

@NonNull
public DomainType visitTemplateableTypeId(@NonNull
                                                  TemplateableTypeId id)
Specified by:
visitTemplateableTypeId in interface IdVisitor<DomainElement>

visitTuplePartId

@NonNull
public DomainTypedElement visitTuplePartId(@NonNull
                                                   TuplePartId id)
Specified by:
visitTuplePartId in interface IdVisitor<DomainElement>

visitTupleTypeId

@NonNull
public DomainType visitTupleTypeId(@NonNull
                                           TupleTypeId id)
Specified by:
visitTupleTypeId in interface IdVisitor<DomainElement>

visitUnspecifiedId

@NonNull
public DomainType visitUnspecifiedId(@NonNull
                                             UnspecifiedId id)
Specified by:
visitUnspecifiedId in interface IdVisitor<DomainElement>

weakGet

protected <K,V> V weakGet(@NonNull
                          java.util.Map<K,java.lang.ref.WeakReference<V>> map,
                          @NonNull
                          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.