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.NodeFacade;
010import org.omg.uml.foundation.core.Node;
011
012/**
013 * A computational resource upon which artifacts may be deployed for execution. Nodes can be
014 * interconnected through communication paths to define network structures.
015 * MetafacadeLogic for NodeFacade
016 *
017 * @see NodeFacade
018 */
019public abstract class NodeFacadeLogic
020    extends ClassifierFacadeLogicImpl
021    implements NodeFacade
022{
023    /**
024     * The underlying UML object
025     * @see Node
026     */
027    protected Node metaObject;
028
029    /** Create Metafacade implementation instance using the MetafacadeFactory from the context
030     * @param metaObjectIn
031     * @param context
032     */
033    protected NodeFacadeLogic(Node 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 NodeFacade 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.NodeFacade";
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 NodeFacade
069     */
070    public boolean isNodeFacadeMetaType()
071    {
072        return true;
073    }
074
075    /**
076     * @param validationMessages Collection<ModelValidationMessage>
077     * @see ClassifierFacadeLogicImpl#validateInvariants(Collection validationMessages)
078     */
079    @Override
080    public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
081    {
082        super.validateInvariants(validationMessages);
083    }
084}