All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.andromda.metafacades.emf.uml22.UseCaseFacadeLogicImpl Maven / Gradle / Ivy

Go to download

The Eclipse EMF UML2 v2.X metafacades. This is the set of EMF UML2 2.X metafacades implementations. These implement the common UML metafacades for .uml model files.

The newest version!
package org.andromda.metafacades.emf.uml22;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import org.andromda.metafacades.uml.ModelElementFacade;
import org.andromda.utils.StringUtilsHelper;
import org.eclipse.uml2.uml.Behavior;
import org.eclipse.uml2.uml.Extend;
import org.eclipse.uml2.uml.ExtensionPoint;
import org.eclipse.uml2.uml.Include;
import org.eclipse.uml2.uml.StateMachine;
import org.eclipse.uml2.uml.UseCase;

/**
 * MetafacadeLogic implementation for
 * org.andromda.metafacades.uml.UseCaseFacade.
 *
 * @see org.andromda.metafacades.uml.UseCaseFacade
 */
public class UseCaseFacadeLogicImpl
    extends UseCaseFacadeLogic
{
    private static final long serialVersionUID = 34L;
    /**
     * @param metaObjectIn
     * @param context
     */
    public UseCaseFacadeLogicImpl(
        final UseCase metaObjectIn,
        final String context)
    {
        super(metaObjectIn, context);
    }

    /**
     * @see org.andromda.metafacades.uml.UseCaseFacade#getFirstActivityGraph()
     */
    @Override
    protected StateMachine handleGetFirstActivityGraph()
    {
        StateMachine activityGraph = null;
        final Collection behaviors = new ArrayList();
        behaviors.addAll(this.metaObject.getOwnedBehaviors()); // For MD11.5
        //behaviors.addAll(this.metaObject.getOwnedStateMachines()); // For RSM // No longer exists in UML2 2.x
        for (final Iterator iterator = behaviors.iterator(); iterator.hasNext() && activityGraph == null;)
        {
            final Behavior modelElement = iterator.next();
            if (modelElement instanceof StateMachine)
            {
                activityGraph = (StateMachine)modelElement;
            }
        }

        return activityGraph;
    }

    /**
     * @see org.andromda.metafacades.uml.UseCaseFacade#getExtensionPoints()
     */
    @Override
    protected Collection handleGetExtensionPoints()
    {
        return this.metaObject.getExtensionPoints();
    }

    /**
     * @see org.andromda.metafacades.uml.UseCaseFacade#getExtends()
     */
    @Override
    protected Collection handleGetExtends()
    {
        return this.metaObject.getExtends();
    }

    /**
     * @see org.andromda.metafacades.emf.uml22.ClassifierFacadeLogicImpl#handleGetName()
     */
    @Override
    protected String handleGetName()
    {
        return StringUtilsHelper.toSingleLine(super.handleGetName());
    }

    /**
     * @see org.andromda.metafacades.emf.uml22.UseCaseFacadeLogic#handleGetIncludes()
     */
    @Override
    protected Collection handleGetIncludes()
    {
        return this.metaObject.getIncludes();
    }

    /**
     * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
     */
    @Override
    public ModelElementFacade getValidationOwner()
    {
        return this.getPackage();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy