org.andromda.metafacades.uml14.PartitionFacadeLogic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of andromda-metafacades-uml14 Show documentation
Show all versions of andromda-metafacades-uml14 Show documentation
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 java.util.List;
import org.andromda.core.metafacade.MetafacadeBase;
import org.andromda.core.metafacade.ModelValidationMessage;
import org.andromda.metafacades.uml.ActivityGraphFacade;
import org.andromda.metafacades.uml.PartitionFacade;
import org.andromda.metafacades.uml.StateVertexFacade;
import org.apache.log4j.Logger;
import org.omg.uml.behavioralelements.activitygraphs.Partition;
/**
*
* A representation of the model object 'Region'. An orthogonal
* part of either a composite state or a state machine. It contains
* states and transitions.
*
* MetafacadeLogic for PartitionFacade
*
* @see PartitionFacade
*/
public abstract class PartitionFacadeLogic
extends ModelElementFacadeLogicImpl
implements PartitionFacade
{
/**
* The underlying UML object
* @see Partition
*/
protected Partition metaObject;
/** Create Metafacade implementation instance using the MetafacadeFactory from the context
* @param metaObjectIn
* @param context
*/
protected PartitionFacadeLogic(Partition metaObjectIn, String context)
{
super(metaObjectIn, getContext(context));
this.metaObject = metaObjectIn;
}
/**
* The logger instance.
*/
private static final Logger logger = Logger.getLogger(PartitionFacadeLogic.class);
/**
* Gets the context for this metafacade logic instance.
* @param context String. Set to PartitionFacade if null
* @return context String
*/
private static String getContext(String context)
{
if (context == null)
{
context = "org.andromda.metafacades.uml.PartitionFacade";
}
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 PartitionFacade
*/
public boolean isPartitionFacadeMetaType()
{
return true;
}
// ------------- associations ------------------
/**
*
* The set of partitions contained in this activity graph.
* Partitions are also known as swimlanes in UML.
*
* @return (ActivityGraphFacade)handleGetActivityGraph()
*/
public final ActivityGraphFacade getActivityGraph()
{
ActivityGraphFacade getActivityGraph1r = null;
// partitions has no pre constraints
Object result = handleGetActivityGraph();
MetafacadeBase shieldedResult = this.shieldedElement(result);
try
{
getActivityGraph1r = (ActivityGraphFacade)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
PartitionFacadeLogic.logger.warn("incorrect metafacade cast for PartitionFacadeLogic.getActivityGraph ActivityGraphFacade " + result + ": " + shieldedResult);
}
// partitions has no post constraints
return getActivityGraph1r;
}
/**
* UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
* @return Object
*/
protected abstract Object handleGetActivityGraph();
private Collection __getVertices2r;
private boolean __getVertices2rSet = false;
/**
*
* The partition (if any) to which this vertex belongs.
*
* @return (Collection)handleGetVertices()
*/
public final Collection getVertices()
{
Collection getVertices2r = this.__getVertices2r;
if (!this.__getVertices2rSet)
{
// partition has no pre constraints
Collection result = handleGetVertices();
List shieldedResult = this.shieldedElements(result);
try
{
getVertices2r = (Collection)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
PartitionFacadeLogic.logger.warn("incorrect metafacade cast for PartitionFacadeLogic.getVertices Collection " + result + ": " + shieldedResult);
}
// partition has no post constraints
this.__getVertices2r = getVertices2r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getVertices2rSet = true;
}
}
return getVertices2r;
}
/**
* UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
* @return Collection
*/
protected abstract Collection handleGetVertices();
/**
* @param validationMessages Collection
* @see ModelElementFacadeLogicImpl#validateInvariants(Collection validationMessages)
*/
@Override
public void validateInvariants(Collection validationMessages)
{
super.validateInvariants(validationMessages);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy