org.andromda.metafacades.emf.uml22.ActivityGraphFacadeLogic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of andromda-metafacades-emf-uml22 Show documentation
Show all versions of andromda-metafacades-emf-uml22 Show documentation
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.ActionStateFacade;
import org.andromda.metafacades.uml.ActivityGraphFacade;
import org.andromda.metafacades.uml.ObjectFlowStateFacade;
import org.andromda.metafacades.uml.PartitionFacade;
import org.andromda.metafacades.uml.UseCaseFacade;
import org.apache.log4j.Logger;
import org.eclipse.uml2.uml.StateMachine;
/**
*
* State machines can be used to express the behavior of part of a
* system. Behavior is modeled as a traversal of a graph of state
* nodes interconnected by one or more joined transition arcs that
* are triggered by the dispatching of series of (event)
* occurrences. During this traversal, the state machine executes a
* series of activities associated with various elements of the
* state machine.
*
* MetafacadeLogic for ActivityGraphFacade
*
* @see ActivityGraphFacade
*/
public abstract class ActivityGraphFacadeLogic
extends StateMachineFacadeLogicImpl
implements ActivityGraphFacade
{
/**
* The underlying UML object
* @see StateMachine
*/
protected StateMachine metaObject;
/** Create Metafacade implementation instance using the MetafacadeFactory from the context
* @param metaObjectIn
* @param context
*/
protected ActivityGraphFacadeLogic(StateMachine metaObjectIn, String context)
{
super(metaObjectIn, getContext(context));
this.metaObject = metaObjectIn;
}
/**
* The logger instance.
*/
private static final Logger logger = Logger.getLogger(ActivityGraphFacadeLogic.class);
/**
* Gets the context for this metafacade logic instance.
* @param context String. Set to ActivityGraphFacade if null
* @return context String
*/
private static String getContext(String context)
{
if (context == null)
{
context = "org.andromda.metafacades.uml.ActivityGraphFacade";
}
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 ActivityGraphFacade
*/
public boolean isActivityGraphFacadeMetaType()
{
return true;
}
// ------------- associations ------------------
/**
*
* @return (Collection)handleGetActionStates()
*/
public final Collection getActionStates()
{
Collection getActionStates1r = null;
// activityGraphFacade has no pre constraints
Collection result = handleGetActionStates();
List shieldedResult = this.shieldedElements(result);
try
{
getActionStates1r = (Collection)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ActivityGraphFacadeLogic.logger.warn("incorrect metafacade cast for ActivityGraphFacadeLogic.getActionStates Collection " + result + ": " + shieldedResult);
}
// activityGraphFacade has no post constraints
return getActionStates1r;
}
/**
* UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
* @return Collection
*/
protected abstract Collection handleGetActionStates();
/**
*
* @return (Collection)handleGetObjectFlowStates()
*/
public final Collection getObjectFlowStates()
{
Collection getObjectFlowStates2r = null;
// activityGraphFacade has no pre constraints
Collection result = handleGetObjectFlowStates();
List shieldedResult = this.shieldedElements(result);
try
{
getObjectFlowStates2r = (Collection)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ActivityGraphFacadeLogic.logger.warn("incorrect metafacade cast for ActivityGraphFacadeLogic.getObjectFlowStates Collection " + result + ": " + shieldedResult);
}
// activityGraphFacade has no post constraints
return getObjectFlowStates2r;
}
/**
* UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
* @return Collection
*/
protected abstract Collection handleGetObjectFlowStates();
/**
*
* The first activity graph directly owned by this use-case.
*
* @return (UseCaseFacade)handleGetUseCase()
*/
public final UseCaseFacade getUseCase()
{
UseCaseFacade getUseCase3r = null;
// firstActivityGraph has no pre constraints
Object result = handleGetUseCase();
MetafacadeBase shieldedResult = this.shieldedElement(result);
try
{
getUseCase3r = (UseCaseFacade)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ActivityGraphFacadeLogic.logger.warn("incorrect metafacade cast for ActivityGraphFacadeLogic.getUseCase UseCaseFacade " + result + ": " + shieldedResult);
}
// firstActivityGraph has no post constraints
return getUseCase3r;
}
/**
* UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
* @return Object
*/
protected abstract Object handleGetUseCase();
/**
*
* @return (Collection)handleGetPartitions()
*/
public final Collection getPartitions()
{
Collection getPartitions4r = null;
// activityGraph has no pre constraints
Collection result = handleGetPartitions();
List shieldedResult = this.shieldedElements(result);
try
{
getPartitions4r = (Collection)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ActivityGraphFacadeLogic.logger.warn("incorrect metafacade cast for ActivityGraphFacadeLogic.getPartitions Collection " + result + ": " + shieldedResult);
}
// activityGraph has no post constraints
return getPartitions4r;
}
/**
* UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
* @return Collection
*/
protected abstract Collection handleGetPartitions();
/**
* @param validationMessages Collection
* @see StateMachineFacadeLogicImpl#validateInvariants(Collection validationMessages)
*/
@Override
public void validateInvariants(Collection validationMessages)
{
super.validateInvariants(validationMessages);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy