001// license-header java merge-point
002//
003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
004//
005package org.andromda.metafacades.uml14;
006
007import java.util.Collection;
008import org.andromda.core.metafacade.ModelValidationMessage;
009import org.andromda.metafacades.uml.FinalStateFacade;
010import org.omg.uml.behavioralelements.statemachines.FinalState;
011
012/**
013 * A special kind of state signifying that the enclosing region is completed. If the enclosing
014 * region is directly contained in a state machine and all other regions in the state machine also
015 * are completed, then it means that the entire state machine is completed.
016 * MetafacadeLogic for FinalStateFacade
017 *
018 * @see FinalStateFacade
019 */
020public abstract class FinalStateFacadeLogic
021    extends StateFacadeLogicImpl
022    implements FinalStateFacade
023{
024    /**
025     * The underlying UML object
026     * @see FinalState
027     */
028    protected FinalState metaObject;
029
030    /** Create Metafacade implementation instance using the MetafacadeFactory from the context
031     * @param metaObjectIn
032     * @param context
033     */
034    protected FinalStateFacadeLogic(FinalState metaObjectIn, String context)
035    {
036        super(metaObjectIn, getContext(context));
037        this.metaObject = metaObjectIn;
038    }
039
040    /**
041     * Gets the context for this metafacade logic instance.
042     * @param context String. Set to FinalStateFacade if null
043     * @return context String
044     */
045    private static String getContext(String context)
046    {
047        if (context == null)
048        {
049            context = "org.andromda.metafacades.uml.FinalStateFacade";
050        }
051        return context;
052    }
053
054    /** Reset context only for non-root metafacades
055     * @param context
056     */
057    @Override
058    public void resetMetafacadeContext(String context)
059    {
060        if (!this.contextRoot) // reset context only for non-root metafacades
061        {
062            context = getContext(context);  // to have same value as in original constructor call
063            setMetafacadeContext (context);
064        }
065    }
066
067    /**
068     * @return boolean true always
069     * @see FinalStateFacade
070     */
071    public boolean isFinalStateFacadeMetaType()
072    {
073        return true;
074    }
075
076    // ------------- associations ------------------
077
078    /**
079     * @param validationMessages Collection<ModelValidationMessage>
080     * @see StateFacadeLogicImpl#validateInvariants(Collection validationMessages)
081     */
082    @Override
083    public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
084    {
085        super.validateInvariants(validationMessages);
086    }
087}