001package org.andromda.metafacades.uml14;
002
003import org.omg.uml.behavioralelements.statemachines.Guard;
004import org.omg.uml.behavioralelements.statemachines.Transition;
005import org.omg.uml.foundation.datatypes.BooleanExpression;
006
007/**
008 * MetafacadeLogic implementation.
009 *
010 * @see org.andromda.metafacades.uml.GuardFacade
011 * @author Bob Fields
012 */
013public class GuardFacadeLogicImpl
014        extends GuardFacadeLogic
015{
016    private static final long serialVersionUID = -6392947981148041940L;
017
018    /**
019     * @param metaObject
020     * @param context
021     */
022    public GuardFacadeLogicImpl(Guard metaObject,
023                                String context)
024    {
025        super(metaObject, context);
026    }
027
028    /**
029     * @see org.andromda.metafacades.uml14.GuardFacadeLogic#handleGetTransition()
030     */
031    protected Transition handleGetTransition()
032    {
033        return metaObject.getTransition();
034    }
035
036    /**
037     * @see org.andromda.metafacades.uml14.GuardFacadeLogic#handleGetBody()
038     */
039    protected String handleGetBody()
040    {
041        final BooleanExpression expression = metaObject.getExpression();
042        return (expression == null) ? null : expression.getBody();
043    }
044
045    /**
046     * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
047     */
048    public Object getValidationOwner()
049    {
050        return getTransition();
051    }
052}