org.andromda.metafacades.emf.uml22.FrontEndParameterLogicImpl 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!
package org.andromda.metafacades.emf.uml22;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashSet;
import org.andromda.metafacades.uml.AttributeFacade;
import org.andromda.metafacades.uml.ClassifierFacade;
import org.andromda.metafacades.uml.EventFacade;
import org.andromda.metafacades.uml.FrontEndAction;
import org.andromda.metafacades.uml.FrontEndControllerOperation;
import org.andromda.metafacades.uml.FrontEndEvent;
import org.andromda.metafacades.uml.FrontEndForward;
import org.andromda.metafacades.uml.ModelElementFacade;
import org.andromda.metafacades.uml.OperationFacade;
import org.andromda.metafacades.uml.TransitionFacade;
import org.andromda.metafacades.uml.UMLProfile;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
/**
* MetafacadeLogic implementation for
* org.andromda.metafacades.uml.FrontEndParameter.
*
* @see org.andromda.metafacades.uml.FrontEndParameter
*/
public class FrontEndParameterLogicImpl
extends FrontEndParameterLogic
{
private static final long serialVersionUID = -5932754222510758357L;
/**
* @param metaObject
* @param context
*/
public FrontEndParameterLogicImpl(
final Object metaObject,
final String context)
{
super(metaObject, context);
}
/**
* @see org.andromda.metafacades.uml.FrontEndParameter#isControllerOperationArgument()
*/
@Override
protected boolean handleIsControllerOperationArgument()
{
return this.getControllerOperation() != null;
}
/**
* @see org.andromda.metafacades.uml.FrontEndParameter#getControllerOperation()
*/
@Override
protected OperationFacade handleGetControllerOperation()
{
return this.getOperation();
}
/**
* @see org.andromda.metafacades.uml.FrontEndParameter#isContainedInFrontEndUseCase()
*/
@Override
protected boolean handleIsContainedInFrontEndUseCase()
{
return this.getEvent() instanceof FrontEndEvent || this.getOperation() instanceof FrontEndControllerOperation;
}
/**
* @see org.andromda.metafacades.uml.FrontEndParameter#getView()
*/
@Override
protected Object handleGetView()
{
Object view = null;
final EventFacade event = this.getEvent();
if (event != null)
{
final TransitionFacade transition = event.getTransition();
if (transition instanceof FrontEndAction)
{
final FrontEndAction action = (FrontEndAction)transition;
view = action.getInput();
}
else if (transition instanceof FrontEndForward)
{
final FrontEndForward forward = (FrontEndForward)transition;
if (forward.isEnteringView())
{
view = forward.getTarget();
}
}
}
return view;
}
/**
* @see org.andromda.metafacades.uml.FrontEndParameter#isActionParameter()
*/
@Override
protected boolean handleIsActionParameter()
{
final FrontEndAction action = this.getAction();
return action != null && action.getParameters().contains(this.THIS());
}
/**
* @see org.andromda.metafacades.uml.FrontEndParameter#getAction()
*/
@Override
protected FrontEndAction handleGetAction()
{
FrontEndAction actionObject = null;
final EventFacade event = this.getEvent();
if (event != null)
{
final TransitionFacade transition = event.getTransition();
if (transition instanceof FrontEndAction)
{
actionObject = (FrontEndAction)transition;
}
}
return actionObject;
}
/**
* @see org.andromda.metafacades.uml.FrontEndParameter#isTable()
*/
@Override
protected boolean handleIsTable()
{
boolean isTable = false;
final ClassifierFacade type = this.getType();
if (type != null)
{
isTable = isMany() || type.isCollectionType() || type.isArrayType();
if (isTable)
{
final String tableTaggedValue = ObjectUtils.toString(this.findTaggedValue(UMLProfile.TAGGEDVALUE_PRESENTATION_IS_TABLE));
isTable =
StringUtils.isNotBlank(tableTaggedValue) ? Boolean.valueOf(tableTaggedValue.trim()) : true;
if (!isTable)
{
isTable = !this.getTableColumnNames().isEmpty();
}
}
}
return isTable && this.getOperation() == null;
}
/**
* @see org.andromda.metafacades.uml.FrontEndParameter#getTableColumnNames()
*/
@Override
protected Collection handleGetTableColumnNames()
{
final Collection tableColumnNames = new LinkedHashSet();
final Collection
© 2015 - 2024 Weber Informatics LLC | Privacy Policy