Package org.andromda.metafacades.uml14

Source Code of org.andromda.metafacades.uml14.FrontEndEventLogicImpl

package org.andromda.metafacades.uml14;

import java.lang.reflect.Method;
import java.util.Collections;
import java.util.List;

import org.andromda.metafacades.uml.FrontEndAction;
import org.andromda.metafacades.uml.FrontEndForward;
import org.andromda.metafacades.uml.TransitionFacade;


/**
* MetafacadeLogic implementation for org.andromda.metafacades.uml.FrontEndEvent.
*
* @see org.andromda.metafacades.uml.FrontEndEvent
*/
public class FrontEndEventLogicImpl
    extends FrontEndEventLogic
{

    public FrontEndEventLogicImpl (Object metaObject, String context)
    {
        super (metaObject, context);
    }

    /**
     * @see org.andromda.metafacades.uml.FrontEndEvent#isContainedInFrontEndUseCase()
     */
    protected boolean handleIsContainedInFrontEndUseCase()
    {
        return this.getTransition() instanceof FrontEndForward;
    }

    /**
     * @see org.andromda.metafacades.uml.FrontEndEvent#getControllerCall()
     */
    protected Object handleGetControllerCall()
    {
        // - hack until a solution is found to workaround the JMI multiple inheritance (through interfaces)
        try
        {
            final Method method = metaObject.getClass().getMethod("getOperation", (Class[])null);
            return method.invoke(metaObject, (Object[])null);
        }
        catch (Exception ex)
        {
            return null;
        }
    }
   
    /**
     * @see org.andromda.metafacades.uml.FrontEndEvent#getAction()
     */
    protected Object handleGetAction()
    {
        FrontEndAction action = null;
        TransitionFacade transition = getTransition();
        if (transition instanceof FrontEndAction)
        {
            action = (FrontEndAction)transition;
        }
        return action;
    }

    /**
     * @see org.andromda.metafacades.uml14.FrontEndEvent#getControllerCalls()
     */
    protected List handleGetControllerCalls()
    {
        Object controllerCall = this.getControllerCall();
        return controllerCall == null ? Collections.EMPTY_LIST : Collections.singletonList(controllerCall);
    }

}
TOP

Related Classes of org.andromda.metafacades.uml14.FrontEndEventLogicImpl

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.