Overview

 
Package  Use  Tree  Deprecated  Index  Help 
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

org.eclipse.emf.mapping.impl
Class MappingRootImpl

java.lang.Object
  extended byorg.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended byorg.eclipse.emf.ecore.impl.BasicEObjectImpl
          extended byorg.eclipse.emf.ecore.impl.EObjectImpl
              extended byorg.eclipse.emf.mapping.impl.MappingImpl
                  extended byorg.eclipse.emf.mapping.impl.MappingRootImpl

All Implemented Interfaces:
EObject, InternalEObject, Mapping, MappingRoot, Notifier

Direct Known Subclasses:
Ecore2EcoreMappingRootImpl


public class MappingRootImpl
extends MappingImpl
implements MappingRoot

An implementation of the model object 'Root'.

The following features are implemented:


Nested Class Summary
protected  class MappingRootImpl.MappedObjectStateAdapter
          This is a simple implementation of the basic information that needs to be maintained for any mapped object.
protected  class MappingRootImpl.MappedObjectStateAdapterFactory
          This is the factory that creates adapters for the objects being mapped.
 
Nested classes inherited from class org.eclipse.emf.mapping.impl.MappingImpl
MappingImpl.MappingTreeIterator
 
Nested classes inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
BasicEObjectImpl.EPropertiesHolder, BasicEObjectImpl.EPropertiesHolderImpl
 
Nested classes inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
BasicNotifierImpl.EAdapterList
 
Nested classes inherited from class org.eclipse.emf.ecore.InternalEObject
InternalEObject.EStore
 
Field Summary
protected static String COMMAND_STACK_EDEFAULT
          The default value of the 'Command Stack' attribute
protected  String commandStack
          The cached value of the 'Command Stack' attribute
protected  MappingDomain domain
          This keeps track of the mapping domain that uses this mapping root.
protected  AdapterImpl mappedObjectListener
          This allows this listen for changes to inputs or outputs.
protected  AdapterFactory mappedObjectStateAdapterFactory
          This keeps track of the factory for creating the MappedObjectState.
protected static boolean OUTPUT_READ_ONLY_EDEFAULT
          The default value of the 'Output Read Only' attribute
protected  boolean outputDirty
          This keeps track of whether the output has been modified.
protected  boolean outputReadOnly
          The cached value of the 'Output Read Only' attribute
protected static boolean TOP_TO_BOTTOM_EDEFAULT
          The default value of the 'Top To Bottom' attribute
protected  boolean topToBottom
          The cached value of the 'Top To Bottom' attribute
 
Fields inherited from class org.eclipse.emf.mapping.impl.MappingImpl
helper, inputs, nested, outputs, typeMapping
 
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eContainer, eContainerFeatureID, EDELIVER, EDYNAMIC_CLASS, eFlags, ELAST_EOBJECT_FLAG, ELAST_NOTIFIER_FLAG, eProperties, EPROXY
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Constructor Summary
protected MappingRootImpl()
           
 
Method Summary
 boolean canCreateMapping(Collection inputs, Collection outputs, Mapping mapping)
          If mapping is null, this checks if a mapping can be created with the given inputs and outputs.
 boolean canRemoveMapping(Mapping mapping)
          This checks if the given mapping can be removed.
protected  Adapter createMappedObjectStateAdapter(Notifier target)
          By default, this creates a new instance of MappingRootImpl.MappedObjectStateAdapter.
protected  AdapterFactory createMappedObjectStateAdapterFactory()
          By default, this creates an adapter factory that delegates createAdapter to createMappedObjectStateAdapter.
protected  Mapping createMapping()
           
 Mapping createMapping(Collection inputs, Collection outputs)
          This creates a new, appropriately-parented, mapping object with the given collections of input and output objects.
 void deregister(Mapping mapping)
          This removes cached information about this mapping.
 void dispose()
          This disposes all the adapters used to record the mapped object state.
 NotificationChain eBasicRemoveFromContainer(NotificationChain msgs)
           
 Object eGet(EStructuralFeature eFeature, boolean resolve)
           
 NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs)
           
 NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs)
           
 boolean eIsSet(EStructuralFeature eFeature)
           
 void eSet(EStructuralFeature eFeature, Object newValue)
           
protected  EClass eStaticClass()
           
 void eUnset(EStructuralFeature eFeature)
           
 Collection getAllMappings(Collection collection)
          This returns the intersection of the result of getMappings(Object) for each object of the collection.
 String getCommandStack()
           
 MappingDomain getDomain()
          This returns the associated mapping domain.
 Collection getExactMappings(Collection collection)
          This returns the subset of mappings returned by getAllMappings(java.util.Collection) such that have each mapping has exactly the collection as its mapped objects, i.e., as return by Mapping#getMappedObjects().
 MappedObjectState getMappedObjectState(Object object)
          This uses the mappedObjectStateAdapterFactory to get an adapter that implements this interface.
 Collection getMappings(Object object)
          This returns a collection of the mappings that refer to the given object.
 Mapping getParentMapping(Collection collection)
          This returns the mapping in the tree that would be the parent of a mapping that has the given collection as its mapped objects.
protected  Collection getTypeClassifiers(Collection collection)
           
 MappingRoot getTypeMappingRoot()
          This returns the root of the type mapping model.
protected  Collection getTypeMappings(Collection inputTypes, Collection outputTypes)
           
protected  boolean hasCompatibleMetaObjects(Collection inputs, Collection outputs)
           
protected  boolean hasCompatibleTypes(Collection inputs, Collection outputs)
           
protected  boolean hasMappedChildren(Mapping mapping)
           
protected  boolean hasMappedParents(Collection inputs, Collection outputs)
           
protected  boolean hasTypeMappings(Collection types)
           
protected  void initializeMappedObjectStates()
           
protected  void initializeNewMapping(Mapping newMapping, Collection inputs, Collection outputs)
           
 boolean isAttachedObject(Object object)
          This returns whether the given object descends from one of the root's input or output objects.
 boolean isBottomObject(Object object)
          This returns whether the given object is a bottom domain object.
 boolean isDirty()
          This method returns true if the mapping tree needs to be saved.
 boolean isInputObject(Object object)
          This returns whether the given object is an input object in the domain.
protected  boolean isMapped(Collection collection, Mapping mapping)
           
 boolean isOutputDirty()
          This method returns true if the mapping output needs to be saved.
 boolean isOutputObject(Object object)
          This returns whether the given object is an output object in the domain.
 boolean isOutputReadOnly()
           
 boolean isTopObject(Object object)
          This returns whether the given object is a top domain object.
 boolean isTopToBottom()
           
protected  void printAdapters()
           
 void refreshMappedObjectStates(Mapping subtree)
          This refreshes the mapped objects states of all mappings rooted at the specified mapping subtree.
 void register(Mapping mapping)
          This adds cached information about this mapping.
 void resetDirty()
          This method resets the mapping and output dirty flags.
 void setCommandStack(String newCommandStack)
           
 void setDomain(MappingDomain domain)
          This sets the domain of this mapping root.
 void setOutputDirty(boolean dirty)
          This method sets the output dirty flag.
 void setOutputReadOnly(boolean newOutputReadOnly)
           
 void setTopToBottom(boolean newTopToBottom)
           
 String toString()
           
protected  void walk(EObject object)
           
 
Methods inherited from class org.eclipse.emf.mapping.impl.MappingImpl
basicGetTypeMapping, basicSetHelper, getBottoms, getEffectiveHelper, getHelper, getInputs, getMappedObjects, getMappingRoot, getNested, getNestedIn, getOutputs, getReceivers, getSenders, getTops, getTypeMapping, isReverse, setHelper, setNestedIn, setTypeMapping, treeIterator, treeIterator
 
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eBasicAdapters, eBasicProperties, eBasicSetContainer, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eIsProxy, eProperties, eSetClass, eSetDeliver, eSetProxyURI
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAllContents, eBaseStructuralFeatureID, eBasicSetContainer, eContainer, eContainingFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicClass, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicIsSet, eDynamicSet, eDynamicUnset, eGet, eHasSettings, eInternalResource, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eResolveProxy, eResource, eSetResource, eSetStore, eSetting, eSettingDelegate, eSettings, eStaticFeatureCount, eStore, eURIFragmentSegment
 
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eNotificationRequired, eNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.mapping.Mapping
getBottoms, getEffectiveHelper, getHelper, getInputs, getMappedObjects, getMappingRoot, getNested, getNestedIn, getOutputs, getReceivers, getSenders, getTops, getTypeMapping, isReverse, setHelper, setNestedIn, setTypeMapping, treeIterator, treeIterator
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eIsProxy, eResource
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eNotificationRequired
 

 

Field Detail

 

 

OUTPUT_READ_ONLY_EDEFAULT

protected static final boolean OUTPUT_READ_ONLY_EDEFAULT

The default value of the 'Output Read Only' attribute.

See Also:
isOutputReadOnly(), Constant Field Values


 

 

outputReadOnly

protected boolean outputReadOnly

The cached value of the 'Output Read Only' attribute.

See Also:
isOutputReadOnly()


 

 

TOP_TO_BOTTOM_EDEFAULT

protected static final boolean TOP_TO_BOTTOM_EDEFAULT

The default value of the 'Top To Bottom' attribute.

See Also:
isTopToBottom(), Constant Field Values


 

 

topToBottom

protected boolean topToBottom

The cached value of the 'Top To Bottom' attribute.

See Also:
isTopToBottom()


 

 

COMMAND_STACK_EDEFAULT

protected static final String COMMAND_STACK_EDEFAULT

The default value of the 'Command Stack' attribute.

See Also:
getCommandStack()


 

 

commandStack

protected String commandStack

The cached value of the 'Command Stack' attribute.

See Also:
getCommandStack()


 

 

domain

protected MappingDomain domain

This keeps track of the mapping domain that uses this mapping root.


 

 

outputDirty

protected boolean outputDirty

This keeps track of whether the output has been modified.


 

 

mappedObjectListener

protected AdapterImpl mappedObjectListener

This allows this listen for changes to inputs or outputs.


 

 

mappedObjectStateAdapterFactory

protected AdapterFactory mappedObjectStateAdapterFactory

This keeps track of the factory for creating the MappedObjectState.

Constructor Detail

 

 

MappingRootImpl

protected MappingRootImpl()

Method Detail

 

 

eStaticClass

protected EClass eStaticClass()

Overrides:
eStaticClass in class MappingImpl


 

 

isOutputReadOnly

public boolean isOutputReadOnly()

Specified by:
isOutputReadOnly in interface MappingRoot

Returns:
the value of the 'Output Read Only' attribute.
See Also:
MappingRoot.setOutputReadOnly(boolean), MappingPackage.getMappingRoot_OutputReadOnly()


 

 

setOutputReadOnly

public void setOutputReadOnly(boolean newOutputReadOnly)

Specified by:
setOutputReadOnly in interface MappingRoot

Parameters:
newOutputReadOnly - the new value of the 'Output Read Only' attribute.
See Also:
MappingRoot.isOutputReadOnly()


 

 

isTopToBottom

public boolean isTopToBottom()

Specified by:
isTopToBottom in interface MappingRoot

Returns:
the value of the 'Top To Bottom' attribute.
See Also:
MappingRoot.setTopToBottom(boolean), MappingPackage.getMappingRoot_TopToBottom()


 

 

setTopToBottom

public void setTopToBottom(boolean newTopToBottom)

Specified by:
setTopToBottom in interface MappingRoot

Parameters:
newTopToBottom - the new value of the 'Top To Bottom' attribute.
See Also:
MappingRoot.isTopToBottom()


 

 

getCommandStack

public String getCommandStack()

Specified by:
getCommandStack in interface MappingRoot

Returns:
the value of the 'Command Stack' attribute.
See Also:
MappingRoot.setCommandStack(String), MappingPackage.getMappingRoot_CommandStack()


 

 

setCommandStack

public void setCommandStack(String newCommandStack)

Specified by:
setCommandStack in interface MappingRoot

Parameters:
newCommandStack - the new value of the 'Command Stack' attribute.
See Also:
MappingRoot.getCommandStack()


 

 

eInverseAdd

public NotificationChain eInverseAdd(InternalEObject otherEnd,
                                     int featureID,
                                     Class baseClass,
                                     NotificationChain msgs)

Specified by:
eInverseAdd in interface InternalEObject
Overrides:
eInverseAdd in class MappingImpl


 

 

eInverseRemove

public NotificationChain eInverseRemove(InternalEObject otherEnd,
                                        int featureID,
                                        Class baseClass,
                                        NotificationChain msgs)

Specified by:
eInverseRemove in interface InternalEObject
Overrides:
eInverseRemove in class MappingImpl


 

 

eBasicRemoveFromContainer

public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs)

Specified by:
eBasicRemoveFromContainer in interface InternalEObject
Overrides:
eBasicRemoveFromContainer in class MappingImpl


 

 

eGet

public Object eGet(EStructuralFeature eFeature,
                   boolean resolve)

Specified by:
eGet in interface EObject
Overrides:
eGet in class MappingImpl


 

 

eSet

public void eSet(EStructuralFeature eFeature,
                 Object newValue)

Specified by:
eSet in interface EObject
Overrides:
eSet in class MappingImpl


 

 

eUnset

public void eUnset(EStructuralFeature eFeature)

Specified by:
eUnset in interface EObject
Overrides:
eUnset in class MappingImpl


 

 

eIsSet

public boolean eIsSet(EStructuralFeature eFeature)

Specified by:
eIsSet in interface EObject
Overrides:
eIsSet in class MappingImpl


 

 

toString

public String toString()

Overrides:
toString in class MappingImpl


 

 

getDomain

public MappingDomain getDomain()

Description copied from interface: MappingRoot
This returns the associated mapping domain.

Specified by:
getDomain in interface MappingRoot


 

 

setDomain

public void setDomain(MappingDomain domain)

Description copied from interface: MappingRoot
This sets the domain of this mapping root.

Specified by:
setDomain in interface MappingRoot


 

 

refreshMappedObjectStates

public void refreshMappedObjectStates(Mapping subtree)

Description copied from interface: MappingRoot
This refreshes the mapped objects states of all mappings rooted at the specified mapping subtree.

Specified by:
refreshMappedObjectStates in interface MappingRoot


 

 

initializeMappedObjectStates

protected void initializeMappedObjectStates()


 

 

getParentMapping

public Mapping getParentMapping(Collection collection)

Description copied from interface: MappingRoot
This returns the mapping in the tree that would be the parent of a mapping that has the given collection as its mapped objects.

Specified by:
getParentMapping in interface MappingRoot


 

 

isDirty

public boolean isDirty()

Description copied from interface: MappingRoot
This method returns true if the mapping tree needs to be saved.

Specified by:
isDirty in interface MappingRoot


 

 

isOutputDirty

public boolean isOutputDirty()

Description copied from interface: MappingRoot
This method returns true if the mapping output needs to be saved.

Specified by:
isOutputDirty in interface MappingRoot


 

 

register

public void register(Mapping mapping)

Description copied from interface: MappingRoot
This adds cached information about this mapping.

Specified by:
register in interface MappingRoot


 

 

deregister

public void deregister(Mapping mapping)

Description copied from interface: MappingRoot
This removes cached information about this mapping.

Specified by:
deregister in interface MappingRoot


 

 

canCreateMapping

public boolean canCreateMapping(Collection inputs,
                                Collection outputs,
                                Mapping mapping)

Description copied from interface: MappingRoot
If mapping is null, this checks if a mapping can be created with the given inputs and outputs. If mapping is not null, it checks if the specified mapping can be changed to the given inputs and outputs.

Specified by:
canCreateMapping in interface MappingRoot


 

 

canRemoveMapping

public boolean canRemoveMapping(Mapping mapping)

Description copied from interface: MappingRoot
This checks if the given mapping can be removed.

Specified by:
canRemoveMapping in interface MappingRoot


 

 

hasMappedChildren

protected boolean hasMappedChildren(Mapping mapping)


 

 

hasMappedParents

protected boolean hasMappedParents(Collection inputs,
                                   Collection outputs)


 

 

isMapped

protected boolean isMapped(Collection collection,
                           Mapping mapping)


 

 

hasCompatibleMetaObjects

protected boolean hasCompatibleMetaObjects(Collection inputs,
                                           Collection outputs)


 

 

hasCompatibleTypes

protected boolean hasCompatibleTypes(Collection inputs,
                                     Collection outputs)


 

 

getTypeMappings

protected Collection getTypeMappings(Collection inputTypes,
                                     Collection outputTypes)


 

 

hasTypeMappings

protected boolean hasTypeMappings(Collection types)


 

 

getTypeClassifiers

protected Collection getTypeClassifiers(Collection collection)


 

 

createMapping

public Mapping createMapping(Collection inputs,
                             Collection outputs)

Description copied from interface: MappingRoot
This creates a new, appropriately-parented, mapping object with the given collections of input and output objects.

Specified by:
createMapping in interface MappingRoot


 

 

createMapping

protected Mapping createMapping()


 

 

initializeNewMapping

protected void initializeNewMapping(Mapping newMapping,
                                    Collection inputs,
                                    Collection outputs)


 

 

resetDirty

public void resetDirty()

Description copied from interface: MappingRoot
This method resets the mapping and output dirty flags.

Specified by:
resetDirty in interface MappingRoot


 

 

setOutputDirty

public void setOutputDirty(boolean dirty)

Description copied from interface: MappingRoot
This method sets the output dirty flag.

Specified by:
setOutputDirty in interface MappingRoot


 

 

isInputObject

public boolean isInputObject(Object object)

Description copied from interface: MappingRoot
This returns whether the given object is an input object in the domain.

Specified by:
isInputObject in interface MappingRoot


 

 

isOutputObject

public boolean isOutputObject(Object object)

Description copied from interface: MappingRoot
This returns whether the given object is an output object in the domain.

Specified by:
isOutputObject in interface MappingRoot


 

 

isTopObject

public boolean isTopObject(Object object)

Description copied from interface: MappingRoot
This returns whether the given object is a top domain object.

Specified by:
isTopObject in interface MappingRoot


 

 

isBottomObject

public boolean isBottomObject(Object object)

Description copied from interface: MappingRoot
This returns whether the given object is a bottom domain object.

Specified by:
isBottomObject in interface MappingRoot


 

 

isAttachedObject

public boolean isAttachedObject(Object object)

Description copied from interface: MappingRoot
This returns whether the given object descends from one of the root's input or output objects.

Specified by:
isAttachedObject in interface MappingRoot


 

 

getMappings

public Collection getMappings(Object object)

Description copied from interface: MappingRoot
This returns a collection of the mappings that refer to the given object.

Specified by:
getMappings in interface MappingRoot


 

 

getAllMappings

public Collection getAllMappings(Collection collection)

Description copied from interface: MappingRoot
This returns the intersection of the result of getMappings(Object) for each object of the collection.

Specified by:
getAllMappings in interface MappingRoot


 

 

getExactMappings

public Collection getExactMappings(Collection collection)

Description copied from interface: MappingRoot
This returns the subset of mappings returned by MappingRoot.getAllMappings(java.util.Collection) such that have each mapping has exactly the collection as its mapped objects, i.e., as return by Mapping#getMappedObjects().

Specified by:
getExactMappings in interface MappingRoot


 

 

getMappedObjectState

public MappedObjectState getMappedObjectState(Object object)

This uses the mappedObjectStateAdapterFactory to get an adapter that implements this interface.

Specified by:
getMappedObjectState in interface MappingRoot


 

 

getTypeMappingRoot

public MappingRoot getTypeMappingRoot()

Description copied from interface: MappingRoot
This returns the root of the type mapping model.

Specified by:
getTypeMappingRoot in interface MappingRoot


 

 

createMappedObjectStateAdapterFactory

protected AdapterFactory createMappedObjectStateAdapterFactory()

By default, this creates an adapter factory that delegates createAdapter to createMappedObjectStateAdapter.


 

 

createMappedObjectStateAdapter

protected Adapter createMappedObjectStateAdapter(Notifier target)

By default, this creates a new instance of MappingRootImpl.MappedObjectStateAdapter.


 

 

dispose

public void dispose()

Description copied from interface: MappingRoot
This disposes all the adapters used to record the mapped object state.

Specified by:
dispose in interface MappingRoot


 

 

printAdapters

protected void printAdapters()


 

 

walk

protected void walk(EObject object)


 

Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Copyright 2001-2004 IBM Corporation and others.
All Rights Reserved.
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD