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

org.andromda.metafacades.uml14.IncludeFacadeLogic Maven / Gradle / Ivy

Go to download

The UML 1.4 metafacades. This is the set of UML 1.4 metafacades implementations. These implement the common UML metafacades.

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

import java.util.Collection;
import org.andromda.core.metafacade.MetafacadeBase;
import org.andromda.core.metafacade.ModelValidationMessage;
import org.andromda.metafacades.uml.IncludeFacade;
import org.andromda.metafacades.uml.UseCaseFacade;
import org.apache.log4j.Logger;
import org.omg.uml.behavioralelements.usecases.Include;

/**
 * 

* An include relationship defines that a use case contains the * behavior defined in another use case. *

* MetafacadeLogic for IncludeFacade * * @see IncludeFacade */ public abstract class IncludeFacadeLogic extends ModelElementFacadeLogicImpl implements IncludeFacade { /** * The underlying UML object * @see Include */ protected Include metaObject; /** Create Metafacade implementation instance using the MetafacadeFactory from the context * @param metaObjectIn * @param context */ protected IncludeFacadeLogic(Include metaObjectIn, String context) { super(metaObjectIn, getContext(context)); this.metaObject = metaObjectIn; } /** * The logger instance. */ private static final Logger logger = Logger.getLogger(IncludeFacadeLogic.class); /** * Gets the context for this metafacade logic instance. * @param context String. Set to IncludeFacade if null * @return context String */ private static String getContext(String context) { if (context == null) { context = "org.andromda.metafacades.uml.IncludeFacade"; } 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 IncludeFacade */ public boolean isIncludeFacadeMetaType() { return true; } // ------------- associations ------------------ /** * * @return (UseCaseFacade)handleGetBase() */ public final UseCaseFacade getBase() { UseCaseFacade getBase1r = null; // includes has no pre constraints Object result = handleGetBase(); MetafacadeBase shieldedResult = this.shieldedElement(result); try { getBase1r = (UseCaseFacade)shieldedResult; } catch (ClassCastException ex) { // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn IncludeFacadeLogic.logger.warn("incorrect metafacade cast for IncludeFacadeLogic.getBase UseCaseFacade " + result + ": " + shieldedResult); } // includes has no post constraints return getBase1r; } /** * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type * @return Object */ protected abstract Object handleGetBase(); /** * * @return (UseCaseFacade)handleGetAddition() */ public final UseCaseFacade getAddition() { UseCaseFacade getAddition2r = null; // includeFacade has no pre constraints Object result = handleGetAddition(); MetafacadeBase shieldedResult = this.shieldedElement(result); try { getAddition2r = (UseCaseFacade)shieldedResult; } catch (ClassCastException ex) { // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn IncludeFacadeLogic.logger.warn("incorrect metafacade cast for IncludeFacadeLogic.getAddition UseCaseFacade " + result + ": " + shieldedResult); } // includeFacade has no post constraints return getAddition2r; } /** * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type * @return Object */ protected abstract Object handleGetAddition(); /** * @param validationMessages Collection * @see ModelElementFacadeLogicImpl#validateInvariants(Collection validationMessages) */ @Override public void validateInvariants(Collection validationMessages) { super.validateInvariants(validationMessages); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy