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.FrontEndExceptionHandler;
010
011/**
012 * A front-end exception handler intercepts exceptions and delegates them into a front-end action
013 * state that will handle it (for example by simply displaying it if the action state happened to be
014 * a view) .
015 * MetafacadeLogic for FrontEndExceptionHandler
016 *
017 * @see FrontEndExceptionHandler
018 */
019public abstract class FrontEndExceptionHandlerLogic
020    extends FrontEndForwardLogicImpl
021    implements FrontEndExceptionHandler
022{
023    /**
024     * The underlying UML object
025     * @see Object
026     */
027    protected Object metaObject;
028
029    /** Create Metafacade implementation instance using the MetafacadeFactory from the context
030     * @param metaObjectIn
031     * @param context
032     */
033    protected FrontEndExceptionHandlerLogic(Object metaObjectIn, String context)
034    {
035        super(metaObjectIn, getContext(context));
036        this.metaObject = metaObjectIn;
037    }
038
039    /**
040     * Gets the context for this metafacade logic instance.
041     * @param context String. Set to FrontEndExceptionHandler if null
042     * @return context String
043     */
044    private static String getContext(String context)
045    {
046        if (context == null)
047        {
048            context = "org.andromda.metafacades.uml.FrontEndExceptionHandler";
049        }
050        return context;
051    }
052
053    /** Reset context only for non-root metafacades
054     * @param context
055     */
056    @Override
057    public void resetMetafacadeContext(String context)
058    {
059        if (!this.contextRoot) // reset context only for non-root metafacades
060        {
061            context = getContext(context);  // to have same value as in original constructor call
062            setMetafacadeContext (context);
063        }
064    }
065
066    /**
067     * @return boolean true always
068     * @see FrontEndExceptionHandler
069     */
070    public boolean isFrontEndExceptionHandlerMetaType()
071    {
072        return true;
073    }
074
075    // --------------- attributes ---------------------
076
077   /**
078    * @see FrontEndExceptionHandler#isFrontEndException()
079    * @return boolean
080    */
081    protected abstract boolean handleIsFrontEndException();
082
083    private boolean __frontEndException1a;
084    private boolean __frontEndException1aSet = false;
085
086    /**
087     * Indicatesif this element carries the FrontEndException stereotype.
088     * @return (boolean)handleIsFrontEndException()
089     */
090    public final boolean isFrontEndException()
091    {
092        boolean frontEndException1a = this.__frontEndException1a;
093        if (!this.__frontEndException1aSet)
094        {
095            // frontEndException has no pre constraints
096            frontEndException1a = handleIsFrontEndException();
097            // frontEndException has no post constraints
098            this.__frontEndException1a = frontEndException1a;
099            if (isMetafacadePropertyCachingEnabled())
100            {
101                this.__frontEndException1aSet = true;
102            }
103        }
104        return frontEndException1a;
105    }
106
107    // ------------- associations ------------------
108
109    /**
110     * @param validationMessages Collection<ModelValidationMessage>
111     * @see FrontEndForwardLogicImpl#validateInvariants(Collection validationMessages)
112     */
113    @Override
114    public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
115    {
116        super.validateInvariants(validationMessages);
117    }
118}