StrutsTriggerLogic.java

// license-header java merge-point
//
// Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
//
package org.andromda.cartridges.bpm4struts.metafacades;

import java.util.Collection;
import java.util.List;
import org.andromda.core.common.Introspector;
import org.andromda.core.metafacade.MetafacadeBase;
import org.andromda.core.metafacade.MetafacadeFactory;
import org.andromda.core.metafacade.ModelValidationMessage;
import org.andromda.metafacades.uml.ConstraintFacade;
import org.andromda.metafacades.uml.DependencyFacade;
import org.andromda.metafacades.uml.FrontEndAction;
import org.andromda.metafacades.uml.FrontEndControllerOperation;
import org.andromda.metafacades.uml.FrontEndEvent;
import org.andromda.metafacades.uml.ModelElementFacade;
import org.andromda.metafacades.uml.ModelFacade;
import org.andromda.metafacades.uml.PackageFacade;
import org.andromda.metafacades.uml.ParameterFacade;
import org.andromda.metafacades.uml.StateFacade;
import org.andromda.metafacades.uml.StateMachineFacade;
import org.andromda.metafacades.uml.StereotypeFacade;
import org.andromda.metafacades.uml.TaggedValueFacade;
import org.andromda.metafacades.uml.TemplateParameterFacade;
import org.andromda.metafacades.uml.TransitionFacade;
import org.andromda.metafacades.uml.TypeMappings;
import org.andromda.translation.ocl.validation.OCLCollections;
import org.andromda.translation.ocl.validation.OCLIntrospector;
import org.andromda.translation.ocl.validation.OCLResultEnsurer;
import org.apache.log4j.Logger;

/**
 * A Struts trigger is represented by clicking a hyperlink or posting an action form.
 * MetafacadeLogic for StrutsTrigger
 *
 * @see StrutsTrigger
 */
public abstract class StrutsTriggerLogic
    extends MetafacadeBase
    implements StrutsTrigger
{
    /**
     * The underlying UML object
     * @see Object
     */
    protected Object metaObject;

    /** Create Metafacade implementation instance using the MetafacadeFactory from the context
     * @param metaObjectIn
     * @param context
     */
    protected StrutsTriggerLogic(Object metaObjectIn, String context)
    {
        super(metaObjectIn, getContext(context));
        this.superFrontEndEvent =
           (FrontEndEvent)
            MetafacadeFactory.getInstance().createFacadeImpl(
                    "org.andromda.metafacades.uml.FrontEndEvent",
                    metaObjectIn,
                    getContext(context));
        this.metaObject = metaObjectIn;
    }

    /**
     * The logger instance.
     */
    private static final Logger logger = Logger.getLogger(StrutsTriggerLogic.class);

    /**
     * Gets the context for this metafacade logic instance.
     * @param context String. Set to StrutsTrigger if null
     * @return context String
     */
    private static String getContext(String context)
    {
        if (context == null)
        {
            context = "org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger";
        }
        return context;
    }

    private FrontEndEvent superFrontEndEvent;
    private boolean superFrontEndEventInitialized = false;

    /**
     * Gets the FrontEndEvent parent instance.
     * @return this.superFrontEndEvent FrontEndEvent
     */
    private FrontEndEvent getSuperFrontEndEvent()
    {
        if (!this.superFrontEndEventInitialized)
        {
            ((MetafacadeBase)this.superFrontEndEvent).setMetafacadeContext(this.getMetafacadeContext());
            this.superFrontEndEventInitialized = true;
        }
        return this.superFrontEndEvent;
    }

    /** Reset context only for non-root metafacades
     * @param context
     * @see MetafacadeBase#resetMetafacadeContext(String context)
     */
    @Override
    public void resetMetafacadeContext(String context)
    {
        if (!this.contextRoot) // reset context only for non-root metafacades
        {
            context = getContext(context);  // to have same value as in original constructor call
            setMetafacadeContext (context);
            if (this.superFrontEndEventInitialized)
            {
                ((MetafacadeBase)this.superFrontEndEvent).resetMetafacadeContext(context);
            }
        }
    }

    /**
     * @return boolean true always
     * @see StrutsTrigger
     */
    public boolean isStrutsTriggerMetaType()
    {
        return true;
    }

    // --------------- attributes ---------------------

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getNotAllowedTitleKey()
    * @return String
    */
    protected abstract String handleGetNotAllowedTitleKey();

    private String __notAllowedTitleKey1a;
    private boolean __notAllowedTitleKey1aSet = false;

    /**
     * The message key to use as a tooltip when the user is not allowed to use this trigger.
     * @return (String)handleGetNotAllowedTitleKey()
     */
    public final String getNotAllowedTitleKey()
    {
        String notAllowedTitleKey1a = this.__notAllowedTitleKey1a;
        if (!this.__notAllowedTitleKey1aSet)
        {
            // notAllowedTitleKey has no pre constraints
            notAllowedTitleKey1a = handleGetNotAllowedTitleKey();
            // notAllowedTitleKey has no post constraints
            this.__notAllowedTitleKey1a = notAllowedTitleKey1a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__notAllowedTitleKey1aSet = true;
            }
        }
        return notAllowedTitleKey1a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getTitleKey()
    * @return String
    */
    protected abstract String handleGetTitleKey();

    private String __titleKey2a;
    private boolean __titleKey2aSet = false;

    /**
     * The message title key to use as a tooltip for this trigger.
     * @return (String)handleGetTitleKey()
     */
    public final String getTitleKey()
    {
        String titleKey2a = this.__titleKey2a;
        if (!this.__titleKey2aSet)
        {
            // titleKey has no pre constraints
            titleKey2a = handleGetTitleKey();
            // titleKey has no post constraints
            this.__titleKey2a = titleKey2a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__titleKey2aSet = true;
            }
        }
        return titleKey2a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getResetTitleKey()
    * @return String
    */
    protected abstract String handleGetResetTitleKey();

    private String __resetTitleKey3a;
    private boolean __resetTitleKey3aSet = false;

    /**
     * The message reset title key to use as a tooltip for this trigger's reset feature.
     * @return (String)handleGetResetTitleKey()
     */
    public final String getResetTitleKey()
    {
        String resetTitleKey3a = this.__resetTitleKey3a;
        if (!this.__resetTitleKey3aSet)
        {
            // resetTitleKey has no pre constraints
            resetTitleKey3a = handleGetResetTitleKey();
            // resetTitleKey has no post constraints
            this.__resetTitleKey3a = resetTitleKey3a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__resetTitleKey3aSet = true;
            }
        }
        return resetTitleKey3a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getResetNotAllowedTitleKey()
    * @return String
    */
    protected abstract String handleGetResetNotAllowedTitleKey();

    private String __resetNotAllowedTitleKey4a;
    private boolean __resetNotAllowedTitleKey4aSet = false;

    /**
     * Returns the message key to use as a tooltip when the user is not allowed to use reset the
     * form behind this trigger.
     * @return (String)handleGetResetNotAllowedTitleKey()
     */
    public final String getResetNotAllowedTitleKey()
    {
        String resetNotAllowedTitleKey4a = this.__resetNotAllowedTitleKey4a;
        if (!this.__resetNotAllowedTitleKey4aSet)
        {
            // resetNotAllowedTitleKey has no pre constraints
            resetNotAllowedTitleKey4a = handleGetResetNotAllowedTitleKey();
            // resetNotAllowedTitleKey has no post constraints
            this.__resetNotAllowedTitleKey4a = resetNotAllowedTitleKey4a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__resetNotAllowedTitleKey4aSet = true;
            }
        }
        return resetNotAllowedTitleKey4a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getTriggerKey()
    * @return String
    */
    protected abstract String handleGetTriggerKey();

    private String __triggerKey5a;
    private boolean __triggerKey5aSet = false;

    /**
     * The message reset key for this trigger.
     * @return (String)handleGetTriggerKey()
     */
    public final String getTriggerKey()
    {
        String triggerKey5a = this.__triggerKey5a;
        if (!this.__triggerKey5aSet)
        {
            // triggerKey has no pre constraints
            triggerKey5a = handleGetTriggerKey();
            // triggerKey has no post constraints
            this.__triggerKey5a = triggerKey5a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__triggerKey5aSet = true;
            }
        }
        return triggerKey5a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getTriggerValue()
    * @return String
    */
    protected abstract String handleGetTriggerValue();

    private String __triggerValue6a;
    private boolean __triggerValue6aSet = false;

    /**
     * The resource message value  for this trigger, this would be the button label or hyperlink
     * name.
     * @return (String)handleGetTriggerValue()
     */
    public final String getTriggerValue()
    {
        String triggerValue6a = this.__triggerValue6a;
        if (!this.__triggerValue6aSet)
        {
            // triggerValue has no pre constraints
            triggerValue6a = handleGetTriggerValue();
            // triggerValue has no post constraints
            this.__triggerValue6a = triggerValue6a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__triggerValue6aSet = true;
            }
        }
        return triggerValue6a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getTitleValue()
    * @return String
    */
    protected abstract String handleGetTitleValue();

    private String __titleValue7a;
    private boolean __titleValue7aSet = false;

    /**
     * The default resource message value  for this trigger's tooltip.
     * @return (String)handleGetTitleValue()
     */
    public final String getTitleValue()
    {
        String titleValue7a = this.__titleValue7a;
        if (!this.__titleValue7aSet)
        {
            // titleValue has no pre constraints
            titleValue7a = handleGetTitleValue();
            // titleValue has no post constraints
            this.__titleValue7a = titleValue7a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__titleValue7aSet = true;
            }
        }
        return titleValue7a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getResetTitleValue()
    * @return String
    */
    protected abstract String handleGetResetTitleValue();

    private String __resetTitleValue8a;
    private boolean __resetTitleValue8aSet = false;

    /**
     * The tooltip value for this trigger's reset feature.
     * @return (String)handleGetResetTitleValue()
     */
    public final String getResetTitleValue()
    {
        String resetTitleValue8a = this.__resetTitleValue8a;
        if (!this.__resetTitleValue8aSet)
        {
            // resetTitleValue has no pre constraints
            resetTitleValue8a = handleGetResetTitleValue();
            // resetTitleValue has no post constraints
            this.__resetTitleValue8a = resetTitleValue8a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__resetTitleValue8aSet = true;
            }
        }
        return resetTitleValue8a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getResetNotAllowedTitleValue()
    * @return String
    */
    protected abstract String handleGetResetNotAllowedTitleValue();

    private String __resetNotAllowedTitleValue9a;
    private boolean __resetNotAllowedTitleValue9aSet = false;

    /**
     * The message value to use as a tooltip when the user is not allowed to use reset the form
     * behind this trigger.
     * @return (String)handleGetResetNotAllowedTitleValue()
     */
    public final String getResetNotAllowedTitleValue()
    {
        String resetNotAllowedTitleValue9a = this.__resetNotAllowedTitleValue9a;
        if (!this.__resetNotAllowedTitleValue9aSet)
        {
            // resetNotAllowedTitleValue has no pre constraints
            resetNotAllowedTitleValue9a = handleGetResetNotAllowedTitleValue();
            // resetNotAllowedTitleValue has no post constraints
            this.__resetNotAllowedTitleValue9a = resetNotAllowedTitleValue9a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__resetNotAllowedTitleValue9aSet = true;
            }
        }
        return resetNotAllowedTitleValue9a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getNotAllowedTitleValue()
    * @return String
    */
    protected abstract String handleGetNotAllowedTitleValue();

    private String __notAllowedTitleValue10a;
    private boolean __notAllowedTitleValue10aSet = false;

    /**
     * The message value to use as a tooltip when the user is not allowed to use this trigger.
     * @return (String)handleGetNotAllowedTitleValue()
     */
    public final String getNotAllowedTitleValue()
    {
        String notAllowedTitleValue10a = this.__notAllowedTitleValue10a;
        if (!this.__notAllowedTitleValue10aSet)
        {
            // notAllowedTitleValue has no pre constraints
            notAllowedTitleValue10a = handleGetNotAllowedTitleValue();
            // notAllowedTitleValue has no post constraints
            this.__notAllowedTitleValue10a = notAllowedTitleValue10a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__notAllowedTitleValue10aSet = true;
            }
        }
        return notAllowedTitleValue10a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#isActionTrigger()
    * @return boolean
    */
    protected abstract boolean handleIsActionTrigger();

    private boolean __actionTrigger11a;
    private boolean __actionTrigger11aSet = false;

    /**
     * True if this trigger is modeled on an action transition. That means, the transition is coming
     * out of an action state with the FrontEndView stereotype. False otherwise.
     * @return (boolean)handleIsActionTrigger()
     */
    public final boolean isActionTrigger()
    {
        boolean actionTrigger11a = this.__actionTrigger11a;
        if (!this.__actionTrigger11aSet)
        {
            // actionTrigger has no pre constraints
            actionTrigger11a = handleIsActionTrigger();
            // actionTrigger has no post constraints
            this.__actionTrigger11a = actionTrigger11a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__actionTrigger11aSet = true;
            }
        }
        return actionTrigger11a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getResetMessageKey()
    * @return String
    */
    protected abstract String handleGetResetMessageKey();

    private String __resetMessageKey12a;
    private boolean __resetMessageKey12aSet = false;

    /**
     * The message key to use for reset button labels.
     * @return (String)handleGetResetMessageKey()
     */
    public final String getResetMessageKey()
    {
        String resetMessageKey12a = this.__resetMessageKey12a;
        if (!this.__resetMessageKey12aSet)
        {
            // resetMessageKey has no pre constraints
            resetMessageKey12a = handleGetResetMessageKey();
            // resetMessageKey has no post constraints
            this.__resetMessageKey12a = resetMessageKey12a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__resetMessageKey12aSet = true;
            }
        }
        return resetMessageKey12a;
    }

   /**
    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsTrigger#getResetMessageValue()
    * @return String
    */
    protected abstract String handleGetResetMessageValue();

    private String __resetMessageValue13a;
    private boolean __resetMessageValue13aSet = false;

    /**
     * The message value to use for reset button labels.
     * @return (String)handleGetResetMessageValue()
     */
    public final String getResetMessageValue()
    {
        String resetMessageValue13a = this.__resetMessageValue13a;
        if (!this.__resetMessageValue13aSet)
        {
            // resetMessageValue has no pre constraints
            resetMessageValue13a = handleGetResetMessageValue();
            // resetMessageValue has no post constraints
            this.__resetMessageValue13a = resetMessageValue13a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__resetMessageValue13aSet = true;
            }
        }
        return resetMessageValue13a;
    }

    // ------------- associations ------------------

    private StrutsAction __getStrutsAction1r;
    private boolean __getStrutsAction1rSet = false;

    /**
     * Returns the trigger that calls this action. Typically this is a button or an hyperlink.
     * @return (StrutsAction)handleGetStrutsAction()
     */
    public final StrutsAction getStrutsAction()
    {
        StrutsAction getStrutsAction1r = this.__getStrutsAction1r;
        if (!this.__getStrutsAction1rSet)
        {
            // actionTrigger has no pre constraints
            Object result = handleGetStrutsAction();
            MetafacadeBase shieldedResult = this.shieldedElement(result);
            try
            {
                getStrutsAction1r = (StrutsAction)shieldedResult;
            }
            catch (ClassCastException ex)
            {
                // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
                StrutsTriggerLogic.logger.warn("incorrect metafacade cast for StrutsTriggerLogic.getStrutsAction StrutsAction " + result + ": " + shieldedResult);
            }
            // actionTrigger has no post constraints
            this.__getStrutsAction1r = getStrutsAction1r;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__getStrutsAction1rSet = true;
            }
        }
        return getStrutsAction1r;
    }

    /**
     * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
     * @return Object
     */
    protected abstract Object handleGetStrutsAction();

    /**
     * @return true
     * @see FrontEndEvent
     */
    public boolean isFrontEndEventMetaType()
    {
        return true;
    }

    /**
     * @return true
     * @see org.andromda.metafacades.uml.EventFacade
     */
    public boolean isEventFacadeMetaType()
    {
        return true;
    }

    /**
     * @return true
     * @see ModelElementFacade
     */
    public boolean isModelElementFacadeMetaType()
    {
        return true;
    }

    // ----------- delegates to FrontEndEvent ------------
    /**
     * The parameters to this event.
     * @see org.andromda.metafacades.uml.EventFacade#getParameters()
     */
    public Collection<ParameterFacade> getParameters()
    {
        return this.getSuperFrontEndEvent().getParameters();
    }

    /**
     * If this event is located on an action state, this will represent that state.
     * @see org.andromda.metafacades.uml.EventFacade#getState()
     */
    public StateFacade getState()
    {
        return this.getSuperFrontEndEvent().getState();
    }

    /**
     * If this event is located on a transition, this represents that transition.
     * @see org.andromda.metafacades.uml.EventFacade#getTransition()
     */
    public TransitionFacade getTransition()
    {
        return this.getSuperFrontEndEvent().getTransition();
    }

    /**
     * The action which triggers the "front-end" event.
     * @see FrontEndEvent#getAction()
     */
    public FrontEndAction getAction()
    {
        return this.getSuperFrontEndEvent().getAction();
    }

    /**
     * The call to the controller for this front-end event (if any).
     * @see FrontEndEvent#getControllerCall()
     */
    public FrontEndControllerOperation getControllerCall()
    {
        return this.getSuperFrontEndEvent().getControllerCall();
    }

    /**
     * Gets all controller operation calls for the front-end event.
     * @see FrontEndEvent#getControllerCalls()
     */
    public List<FrontEndControllerOperation> getControllerCalls()
    {
        return this.getSuperFrontEndEvent().getControllerCalls();
    }

    /**
     * Indicates whether or not this front end event is contained within a FrontEndUseCase.
     * @see FrontEndEvent#isContainedInFrontEndUseCase()
     */
    public boolean isContainedInFrontEndUseCase()
    {
        return this.getSuperFrontEndEvent().isContainedInFrontEndUseCase();
    }

    /**
     * Copies all tagged values from the given ModelElementFacade to this model element facade.
     * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
     */
    public void copyTaggedValues(ModelElementFacade element)
    {
        this.getSuperFrontEndEvent().copyTaggedValues(element);
    }

    /**
     * Finds the tagged value with the specified 'tagName'. In case there are more values the first
     * one found will be returned.
     * @see ModelElementFacade#findTaggedValue(String tagName)
     */
    public Object findTaggedValue(String tagName)
    {
        return this.getSuperFrontEndEvent().findTaggedValue(tagName);
    }

    /**
     * Returns all the values for the tagged value with the specified name. The returned collection
     * will contains only String instances, or will be empty. Never null.
     * @see ModelElementFacade#findTaggedValues(String tagName)
     */
    public Collection<Object> findTaggedValues(String tagName)
    {
        return this.getSuperFrontEndEvent().findTaggedValues(tagName);
    }

    /**
     * Returns the fully qualified name of the model element. The fully qualified name includes
     * complete package qualified name of the underlying model element. The templates parameter will
     * be replaced by the correct one given the binding relation of the parameter to this element.
     * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
     */
    public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
    {
        return this.getSuperFrontEndEvent().getBindedFullyQualifiedName(bindedElement);
    }

    /**
     * Gets all constraints belonging to the model element.
     * @see ModelElementFacade#getConstraints()
     */
    public Collection<ConstraintFacade> getConstraints()
    {
        return this.getSuperFrontEndEvent().getConstraints();
    }

    /**
     * Returns the constraints of the argument kind that have been placed onto this model. Typical
     * kinds are "inv", "pre" and "post". Other kinds are possible.
     * @see ModelElementFacade#getConstraints(String kind)
     */
    public Collection<ConstraintFacade> getConstraints(String kind)
    {
        return this.getSuperFrontEndEvent().getConstraints(kind);
    }

    /**
     * Gets the documentation for the model element, The indent argument is prefixed to each line.
     * By default this method wraps lines after 64 characters.
     * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
     * @see ModelElementFacade#getDocumentation(String indent)
     */
    public String getDocumentation(String indent)
    {
        return this.getSuperFrontEndEvent().getDocumentation(indent);
    }

    /**
     * This method returns the documentation for this model element, with the lines wrapped after
     * the specified number of characters, values of less than 1 will indicate no line wrapping is
     * required. By default paragraphs are returned as HTML.
     * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
     * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
     */
    public String getDocumentation(String indent, int lineLength)
    {
        return this.getSuperFrontEndEvent().getDocumentation(indent, lineLength);
    }

    /**
     * This method returns the documentation for this model element, with the lines wrapped after
     * the specified number of characters, values of less than 1 will indicate no line wrapping is
     * required. HTML style determines if HTML Escaping is applied.
     * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
     */
    public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
    {
        return this.getSuperFrontEndEvent().getDocumentation(indent, lineLength, htmlStyle);
    }

    /**
     * The fully qualified name of this model element.
     * @see ModelElementFacade#getFullyQualifiedName()
     */
    public String getFullyQualifiedName()
    {
        return this.getSuperFrontEndEvent().getFullyQualifiedName();
    }

    /**
     * Returns the fully qualified name of the model element. The fully qualified name includes
     * complete package qualified name of the underlying model element.  If modelName is true, then
     * the original name of the model element (the name contained within the model) will be the name
     * returned, otherwise a name from a language mapping will be returned.
     * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
     */
    public String getFullyQualifiedName(boolean modelName)
    {
        return this.getSuperFrontEndEvent().getFullyQualifiedName(modelName);
    }

    /**
     * Returns the fully qualified name as a path, the returned value always starts with out a slash
     * '/'.
     * @see ModelElementFacade#getFullyQualifiedNamePath()
     */
    public String getFullyQualifiedNamePath()
    {
        return this.getSuperFrontEndEvent().getFullyQualifiedNamePath();
    }

    /**
     * Gets the unique identifier of the underlying model element.
     * @see ModelElementFacade#getId()
     */
    public String getId()
    {
        return this.getSuperFrontEndEvent().getId();
    }

    /**
     * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
     * are not represented by other properties, i.e. native, transient, volatile, synchronized,
     * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
     * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
     * JDK5 compiler level.
     * @see ModelElementFacade#getKeywords()
     */
    public Collection<String> getKeywords()
    {
        return this.getSuperFrontEndEvent().getKeywords();
    }

    /**
     * UML2: Retrieves a localized label for this named element.
     * @see ModelElementFacade#getLabel()
     */
    public String getLabel()
    {
        return this.getSuperFrontEndEvent().getLabel();
    }

    /**
     * The language mappings that have been set for this model element.
     * @see ModelElementFacade#getLanguageMappings()
     */
    public TypeMappings getLanguageMappings()
    {
        return this.getSuperFrontEndEvent().getLanguageMappings();
    }

    /**
     * Return the model containing this model element (multiple models may be loaded and processed
     * at the same time).
     * @see ModelElementFacade#getModel()
     */
    public ModelFacade getModel()
    {
        return this.getSuperFrontEndEvent().getModel();
    }

    /**
     * The name of the model element.
     * @see ModelElementFacade#getName()
     */
    public String getName()
    {
        return this.getSuperFrontEndEvent().getName();
    }

    /**
     * Gets the package to which this model element belongs.
     * @see ModelElementFacade#getPackage()
     */
    public ModelElementFacade getPackage()
    {
        return this.getSuperFrontEndEvent().getPackage();
    }

    /**
     * The name of this model element's package.
     * @see ModelElementFacade#getPackageName()
     */
    public String getPackageName()
    {
        return this.getSuperFrontEndEvent().getPackageName();
    }

    /**
     * Gets the package name (optionally providing the ability to retrieve the model name and not
     * the mapped name).
     * @see ModelElementFacade#getPackageName(boolean modelName)
     */
    public String getPackageName(boolean modelName)
    {
        return this.getSuperFrontEndEvent().getPackageName(modelName);
    }

    /**
     * Returns the package as a path, the returned value always starts with out a slash '/'.
     * @see ModelElementFacade#getPackagePath()
     */
    public String getPackagePath()
    {
        return this.getSuperFrontEndEvent().getPackagePath();
    }

    /**
     * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
     * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
     * the names of the containing namespaces starting at the root of the hierarchy and ending with
     * the name of the NamedElement itself.
     * @see ModelElementFacade#getQualifiedName()
     */
    public String getQualifiedName()
    {
        return this.getSuperFrontEndEvent().getQualifiedName();
    }

    /**
     * Gets the root package for the model element.
     * @see ModelElementFacade#getRootPackage()
     */
    public PackageFacade getRootPackage()
    {
        return this.getSuperFrontEndEvent().getRootPackage();
    }

    /**
     * Gets the dependencies for which this model element is the source.
     * @see ModelElementFacade#getSourceDependencies()
     */
    public Collection<DependencyFacade> getSourceDependencies()
    {
        return this.getSuperFrontEndEvent().getSourceDependencies();
    }

    /**
     * If this model element is the context of an activity graph, this represents that activity
     * graph.
     * @see ModelElementFacade#getStateMachineContext()
     */
    public StateMachineFacade getStateMachineContext()
    {
        return this.getSuperFrontEndEvent().getStateMachineContext();
    }

    /**
     * The collection of ALL stereotype names for this model element.
     * @see ModelElementFacade#getStereotypeNames()
     */
    public Collection<String> getStereotypeNames()
    {
        return this.getSuperFrontEndEvent().getStereotypeNames();
    }

    /**
     * Gets all stereotypes for this model element.
     * @see ModelElementFacade#getStereotypes()
     */
    public Collection<StereotypeFacade> getStereotypes()
    {
        return this.getSuperFrontEndEvent().getStereotypes();
    }

    /**
     * Return the TaggedValues associated with this model element, under all stereotypes.
     * @see ModelElementFacade#getTaggedValues()
     */
    public Collection<TaggedValueFacade> getTaggedValues()
    {
        return this.getSuperFrontEndEvent().getTaggedValues();
    }

    /**
     * Gets the dependencies for which this model element is the target.
     * @see ModelElementFacade#getTargetDependencies()
     */
    public Collection<DependencyFacade> getTargetDependencies()
    {
        return this.getSuperFrontEndEvent().getTargetDependencies();
    }

    /**
     * Get the template parameter for this model element having the parameterName
     * @see ModelElementFacade#getTemplateParameter(String parameterName)
     */
    public Object getTemplateParameter(String parameterName)
    {
        return this.getSuperFrontEndEvent().getTemplateParameter(parameterName);
    }

    /**
     * Get the template parameters for this model element
     * @see ModelElementFacade#getTemplateParameters()
     */
    public Collection<TemplateParameterFacade> getTemplateParameters()
    {
        return this.getSuperFrontEndEvent().getTemplateParameters();
    }

    /**
     * The visibility (i.e. public, private, protected or package) of the model element, will
     * attempt a lookup for these values in the language mappings (if any).
     * @see ModelElementFacade#getVisibility()
     */
    public String getVisibility()
    {
        return this.getSuperFrontEndEvent().getVisibility();
    }

    /**
     * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
     * is taken into account when searching for the stereotype), false otherwise.
     * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
     */
    public boolean hasExactStereotype(String stereotypeName)
    {
        return this.getSuperFrontEndEvent().hasExactStereotype(stereotypeName);
    }

    /**
     * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
     * pipe, semicolon, or << >>
     * @see ModelElementFacade#hasKeyword(String keywordName)
     */
    public boolean hasKeyword(String keywordName)
    {
        return this.getSuperFrontEndEvent().hasKeyword(keywordName);
    }

    /**
     * Returns true if the model element has the specified stereotype.  If the stereotype itself
     * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
     * one of the stereotype's ancestors has a matching name this method will return true, false
     * otherwise.
     * For example, if we have a certain stereotype called <<exception>> and a model element has a
     * stereotype called <<applicationException>> which extends <<exception>>, when calling this
     * method with 'stereotypeName' defined as 'exception' the method would return true since
     * <<applicationException>> inherits from <<exception>>.  If you want to check if the model
     * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
     * @see ModelElementFacade#hasStereotype(String stereotypeName)
     */
    public boolean hasStereotype(String stereotypeName)
    {
        return this.getSuperFrontEndEvent().hasStereotype(stereotypeName);
    }

    /**
     * True if there are target dependencies from this element that are instances of BindingFacade.
     * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
     * @see ModelElementFacade#isBindingDependenciesPresent()
     */
    public boolean isBindingDependenciesPresent()
    {
        return this.getSuperFrontEndEvent().isBindingDependenciesPresent();
    }

    /**
     * Indicates if any constraints are present on this model element.
     * @see ModelElementFacade#isConstraintsPresent()
     */
    public boolean isConstraintsPresent()
    {
        return this.getSuperFrontEndEvent().isConstraintsPresent();
    }

    /**
     * Indicates if any documentation is present on this model element.
     * @see ModelElementFacade#isDocumentationPresent()
     */
    public boolean isDocumentationPresent()
    {
        return this.getSuperFrontEndEvent().isDocumentationPresent();
    }

    /**
     * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
     * @see ModelElementFacade#isReservedWord()
     */
    public boolean isReservedWord()
    {
        return this.getSuperFrontEndEvent().isReservedWord();
    }

    /**
     * True is there are template parameters on this model element. For UML2, applies to Class,
     * Operation, Property, and Parameter.
     * @see ModelElementFacade#isTemplateParametersPresent()
     */
    public boolean isTemplateParametersPresent()
    {
        return this.getSuperFrontEndEvent().isTemplateParametersPresent();
    }

    /**
     * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
     * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
     * Enumerations and Interfaces, optionally applies on other model elements.
     * @see ModelElementFacade#isValidIdentifierName()
     */
    public boolean isValidIdentifierName()
    {
        return this.getSuperFrontEndEvent().isValidIdentifierName();
    }

    /**
     * Searches for the constraint with the specified 'name' on this model element, and if found
     * translates it using the specified 'translation' from a translation library discovered by the
     * framework.
     * @see ModelElementFacade#translateConstraint(String name, String translation)
     */
    public String translateConstraint(String name, String translation)
    {
        return this.getSuperFrontEndEvent().translateConstraint(name, translation);
    }

    /**
     * Translates all constraints belonging to this model element with the given 'translation'.
     * @see ModelElementFacade#translateConstraints(String translation)
     */
    public String[] translateConstraints(String translation)
    {
        return this.getSuperFrontEndEvent().translateConstraints(translation);
    }

    /**
     * Translates the constraints of the specified 'kind' belonging to this model element.
     * @see ModelElementFacade#translateConstraints(String kind, String translation)
     */
    public String[] translateConstraints(String kind, String translation)
    {
        return this.getSuperFrontEndEvent().translateConstraints(kind, translation);
    }

    /**
     * @see MetafacadeBase#initialize()
     */
    @Override
    public void initialize()
    {
        this.getSuperFrontEndEvent().initialize();
    }

    /**
     * @return Object getSuperFrontEndEvent().getValidationOwner()
     * @see MetafacadeBase#getValidationOwner()
     */
    @Override
    public Object getValidationOwner()
    {
        Object owner = this.getSuperFrontEndEvent().getValidationOwner();
        return owner;
    }

    /**
     * @return String getSuperFrontEndEvent().getValidationName()
     * @see MetafacadeBase#getValidationName()
     */
    @Override
    public String getValidationName()
    {
        String name = this.getSuperFrontEndEvent().getValidationName();
        return name;
    }

    /**
     * <p><b>Constraint:</b> org::andromda::cartridges::bpm4struts::metafacades::StrutsTrigger::each action trigger must have a name</p>
     * <p><b>Error:</b> Every trigger modeled on a transition going out of a FrontEndView action state must have a name. These triggers are known as action-triggers.</p>
     * <p><b>OCL:</b> context StrutsTrigger inv: transition.exitingPage implies name->notEmpty()</p>
     * @param validationMessages Collection<ModelValidationMessage>
     * @see MetafacadeBase#validateInvariants(Collection validationMessages)
     */
    @Override
    public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
    {
        this.getSuperFrontEndEvent().validateInvariants(validationMessages);
        try
        {
            final Object contextElement = this.THIS();
            boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"transition.exitingPage"))).booleanValue()?OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name")):true));
            if (!constraintValid)
            {
                validationMessages.add(
                    new ModelValidationMessage(
                        (MetafacadeBase)contextElement ,
                        "org::andromda::cartridges::bpm4struts::metafacades::StrutsTrigger::each action trigger must have a name",
                        "Every trigger modeled on a transition going out of a FrontEndView action state must have a name. These triggers are known as action-triggers."));
            }
        }
        catch (Throwable th)
        {
            Throwable cause = th.getCause();
            int depth = 0; // Some throwables have infinite recursion
            while (cause != null && depth < 7)
            {
                th = cause;
                depth++;
            }
            logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsTrigger::each action trigger must have a name' ON "
                + this.THIS().toString() + ": " + th.getMessage(), th);
        }
    }

    /**
     * The property that stores the name of the metafacade.
     */
    private static final String NAME_PROPERTY = "name";
    private static final String FQNAME_PROPERTY = "fullyQualifiedName";

    /**
     * @see Object#toString()
     */
    @Override
    public String toString()
    {
        final StringBuilder toString = new StringBuilder(this.getClass().getName());
        toString.append("[");
        try
        {
            toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
        }
        catch (final Throwable tryAgain)
        {
            try
            {
                toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
            }
            catch (final Throwable ignore)
            {
                // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
            }
        }
        toString.append("]");
        return toString.toString();
    }
}