All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.andromda.metafacades.emf.uml22.LinkEndFacadeLogic Maven / Gradle / Ivy

Go to download

The Eclipse EMF UML2 v2.X metafacades. This is the set of EMF UML2 2.X metafacades implementations. These implement the common UML metafacades for .uml model files.

The newest version!
// license-header java merge-point
//
// Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
//
package org.andromda.metafacades.emf.uml22;

import java.util.Collection;
import java.util.List;
import org.andromda.core.metafacade.MetafacadeBase;
import org.andromda.core.metafacade.ModelValidationMessage;
import org.andromda.metafacades.uml.AssociationEndFacade;
import org.andromda.metafacades.uml.InstanceFacade;
import org.andromda.metafacades.uml.LinkEndFacade;
import org.andromda.metafacades.uml.LinkFacade;
import org.apache.log4j.Logger;

/**
 * 

* Can be an AttributeLinkImpl or LinkEndImpl. A representation of * the model object 'Slot'. A slot specifies that an entity modeled * by an instance specification has a value or values for a * specific structural feature. *

* MetafacadeLogic for LinkEndFacade * * @see LinkEndFacade */ public abstract class LinkEndFacadeLogic extends ModelElementFacadeLogicImpl implements LinkEndFacade { /** * The underlying UML object * @see LinkEnd */ protected LinkEnd metaObject; /** Create Metafacade implementation instance using the MetafacadeFactory from the context * @param metaObjectIn * @param context */ protected LinkEndFacadeLogic(LinkEnd metaObjectIn, String context) { super(metaObjectIn, getContext(context)); this.metaObject = metaObjectIn; } /** * The logger instance. */ private static final Logger logger = Logger.getLogger(LinkEndFacadeLogic.class); /** * Gets the context for this metafacade logic instance. * @param context String. Set to LinkEndFacade if null * @return context String */ private static String getContext(String context) { if (context == null) { context = "org.andromda.metafacades.uml.LinkEndFacade"; } return context; } /** Reset context only for non-root metafacades * @param 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); } } /** * @return boolean true always * @see LinkEndFacade */ public boolean isLinkEndFacadeMetaType() { return true; } // ------------- associations ------------------ private InstanceFacade __getInstance1r; private boolean __getInstance1rSet = false; /** *

* Those slots that map onto association ends. *

* @return (InstanceFacade)handleGetInstance() */ public final InstanceFacade getInstance() { InstanceFacade getInstance1r = this.__getInstance1r; if (!this.__getInstance1rSet) { // linkEnds has no pre constraints Object result = handleGetInstance(); MetafacadeBase shieldedResult = this.shieldedElement(result); try { getInstance1r = (InstanceFacade)shieldedResult; } catch (ClassCastException ex) { // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn LinkEndFacadeLogic.logger.warn("incorrect metafacade cast for LinkEndFacadeLogic.getInstance InstanceFacade " + result + ": " + shieldedResult); } // linkEnds has no post constraints this.__getInstance1r = getInstance1r; if (isMetafacadePropertyCachingEnabled()) { this.__getInstance1rSet = true; } } return getInstance1r; } /** * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type * @return Object */ protected abstract Object handleGetInstance(); private AssociationEndFacade __getAssociationEnd2r; private boolean __getAssociationEnd2rSet = false; /** * * @return (AssociationEndFacade)handleGetAssociationEnd() */ public final AssociationEndFacade getAssociationEnd() { AssociationEndFacade getAssociationEnd2r = this.__getAssociationEnd2r; if (!this.__getAssociationEnd2rSet) { // linkEndFacade has no pre constraints Object result = handleGetAssociationEnd(); MetafacadeBase shieldedResult = this.shieldedElement(result); try { getAssociationEnd2r = (AssociationEndFacade)shieldedResult; } catch (ClassCastException ex) { // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn LinkEndFacadeLogic.logger.warn("incorrect metafacade cast for LinkEndFacadeLogic.getAssociationEnd AssociationEndFacade " + result + ": " + shieldedResult); } // linkEndFacade has no post constraints this.__getAssociationEnd2r = getAssociationEnd2r; if (isMetafacadePropertyCachingEnabled()) { this.__getAssociationEnd2rSet = true; } } return getAssociationEnd2r; } /** * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type * @return Object */ protected abstract Object handleGetAssociationEnd(); private LinkFacade __getLink3r; private boolean __getLink3rSet = false; /** *

* The two links ends owned by this link. *

* @return (LinkFacade)handleGetLink() */ public final LinkFacade getLink() { LinkFacade getLink3r = this.__getLink3r; if (!this.__getLink3rSet) { // linkEnds has no pre constraints Object result = handleGetLink(); MetafacadeBase shieldedResult = this.shieldedElement(result); try { getLink3r = (LinkFacade)shieldedResult; } catch (ClassCastException ex) { // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn LinkEndFacadeLogic.logger.warn("incorrect metafacade cast for LinkEndFacadeLogic.getLink LinkFacade " + result + ": " + shieldedResult); } // linkEnds has no post constraints this.__getLink3r = getLink3r; if (isMetafacadePropertyCachingEnabled()) { this.__getLink3rSet = true; } } return getLink3r; } /** * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type * @return Object */ protected abstract Object handleGetLink(); private Collection __getInstances4r; private boolean __getInstances4rSet = false; /** * * @return (Collection)handleGetInstances() */ public final Collection getInstances() { Collection getInstances4r = this.__getInstances4r; if (!this.__getInstances4rSet) { // linkEndFacade has no pre constraints Collection result = handleGetInstances(); List shieldedResult = this.shieldedElements(result); try { getInstances4r = (Collection)shieldedResult; } catch (ClassCastException ex) { // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn LinkEndFacadeLogic.logger.warn("incorrect metafacade cast for LinkEndFacadeLogic.getInstances Collection " + result + ": " + shieldedResult); } // linkEndFacade has no post constraints this.__getInstances4r = getInstances4r; if (isMetafacadePropertyCachingEnabled()) { this.__getInstances4rSet = true; } } return getInstances4r; } /** * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type * @return Collection */ protected abstract Collection handleGetInstances(); /** * @param validationMessages Collection * @see ModelElementFacadeLogicImpl#validateInvariants(Collection validationMessages) */ @Override public void validateInvariants(Collection validationMessages) { super.validateInvariants(validationMessages); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy