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.ValueObjectAssociationEnd;
010import org.omg.uml.foundation.core.AssociationEnd;
011
012/**
013 * Represents the association end of a ValueObject.
014 * MetafacadeLogic for ValueObjectAssociationEnd
015 *
016 * @see ValueObjectAssociationEnd
017 */
018public abstract class ValueObjectAssociationEndLogic
019    extends AssociationEndFacadeLogicImpl
020    implements ValueObjectAssociationEnd
021{
022    /**
023     * The underlying UML object
024     * @see Object
025     */
026    protected Object metaObject;
027
028    /** Create Metafacade implementation instance using the MetafacadeFactory from the context
029     * @param metaObjectIn
030     * @param context
031     */
032    protected ValueObjectAssociationEndLogic(Object metaObjectIn, String context)
033    {
034        super((AssociationEnd)metaObjectIn, getContext(context));
035        this.metaObject = metaObjectIn;
036    }
037
038    /**
039     * Gets the context for this metafacade logic instance.
040     * @param context String. Set to ValueObjectAssociationEnd if null
041     * @return context String
042     */
043    private static String getContext(String context)
044    {
045        if (context == null)
046        {
047            context = "org.andromda.metafacades.uml.ValueObjectAssociationEnd";
048        }
049        return context;
050    }
051
052    /** Reset context only for non-root metafacades
053     * @param context
054     */
055    @Override
056    public void resetMetafacadeContext(String context)
057    {
058        if (!this.contextRoot) // reset context only for non-root metafacades
059        {
060            context = getContext(context);  // to have same value as in original constructor call
061            setMetafacadeContext (context);
062        }
063    }
064
065    /**
066     * @return boolean true always
067     * @see ValueObjectAssociationEnd
068     */
069    public boolean isValueObjectAssociationEndMetaType()
070    {
071        return true;
072    }
073
074    // --------------- attributes ---------------------
075
076   /**
077    * @see ValueObjectAssociationEnd#isValueObjectType()
078    * @return boolean
079    */
080    protected abstract boolean handleIsValueObjectType();
081
082    private boolean __valueObjectType1a;
083    private boolean __valueObjectType1aSet = false;
084
085    /**
086     * Indicates if the type of this association is a value object or not.
087     * @return (boolean)handleIsValueObjectType()
088     */
089    public final boolean isValueObjectType()
090    {
091        boolean valueObjectType1a = this.__valueObjectType1a;
092        if (!this.__valueObjectType1aSet)
093        {
094            // valueObjectType has no pre constraints
095            valueObjectType1a = handleIsValueObjectType();
096            // valueObjectType has no post constraints
097            this.__valueObjectType1a = valueObjectType1a;
098            if (isMetafacadePropertyCachingEnabled())
099            {
100                this.__valueObjectType1aSet = true;
101            }
102        }
103        return valueObjectType1a;
104    }
105
106    /**
107     * @param validationMessages Collection<ModelValidationMessage>
108     * @see AssociationEndFacadeLogicImpl#validateInvariants(Collection validationMessages)
109     */
110    @Override
111    public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
112    {
113        super.validateInvariants(validationMessages);
114    }
115}