001package org.andromda.metafacades.uml14;
002
003import org.omg.uml.behavioralelements.activitygraphs.ObjectFlowState;
004import org.omg.uml.behavioralelements.statemachines.CompositeState;
005import org.omg.uml.behavioralelements.statemachines.StateMachine;
006import org.omg.uml.foundation.core.Classifier;
007
008/**
009 * Metaclass facade implementation.
010 * @author Bob Fields
011 */
012public class ObjectFlowStateFacadeLogicImpl
013    extends ObjectFlowStateFacadeLogic
014{
015    private static final long serialVersionUID = 744240821518303756L;
016
017    /**
018     * @param metaObject
019     * @param context
020     */
021    public ObjectFlowStateFacadeLogicImpl(
022        ObjectFlowState metaObject,
023        String context)
024    {
025        super(metaObject, context);
026    }
027
028    /**
029     * @see org.andromda.metafacades.uml14.StateVertexFacadeLogicImpl#handleGetStateMachine()
030     */
031    @Override
032    protected StateMachine handleGetStateMachine()
033    {
034        StateMachine stateMachine = null;
035        CompositeState compositeState = metaObject.getContainer();
036
037        if (compositeState != null)
038        {
039            while (compositeState != null)
040            {
041                stateMachine = compositeState.getStateMachine();
042                compositeState = compositeState.getContainer();
043            }
044        }
045
046        return stateMachine;
047    }
048
049    /**
050     * @see org.andromda.metafacades.uml14.ObjectFlowStateFacadeLogic#handleGetType()
051     */
052    protected Classifier handleGetType()
053    {
054        return metaObject.getType();
055    }
056}