Package org.andromda.metafacades.emf.uml2

Source Code of org.andromda.metafacades.emf.uml2.ActionStateFacadeLogicImpl

package org.andromda.metafacades.emf.uml2;

import java.util.Iterator;

import org.eclipse.uml2.Action;
import org.eclipse.uml2.Activity;


/**
* MetafacadeLogic implementation for
* org.andromda.metafacades.uml.ActionStateFacade.
*
* @see org.andromda.metafacades.uml.ActionStateFacade
*/
public class ActionStateFacadeLogicImpl
    extends ActionStateFacadeLogic
{
    public ActionStateFacadeLogicImpl(
        final org.eclipse.uml2.State metaObject,
        final String context)
    {
        super(metaObject, context);
    }

    /**
     * UML1.4 Entry is an Action, where as in UML2 it's an activity. We have
     * then to return the first action of the activity.
     *
     * @see org.andromda.metafacades.uml.ActionStateFacade#getEntry()
     */
    protected java.lang.Object handleGetEntry()
    {
        Activity activity = this.metaObject.getEntry();
        if (activity != null)
        {
            for (Iterator nodesIt = activity.getNodes().iterator(); nodesIt.hasNext();)
            {
                Object nextNode = nodesIt.next();
                if (nextNode instanceof Action)
                {
                    return nextNode;
                }
            }
        }

        // No action has been found.
        return null;
    }
}
TOP

Related Classes of org.andromda.metafacades.emf.uml2.ActionStateFacadeLogicImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.