001package org.andromda.metafacades.uml14;
002
003import org.omg.uml.behavioralelements.statemachines.Pseudostate;
004import org.omg.uml.foundation.datatypes.PseudostateKindEnum;
005
006/**
007 * Metaclass facade implementation.
008 * @author Bob Fields
009 */
010public class PseudostateFacadeLogicImpl
011    extends PseudostateFacadeLogic
012{
013    private static final long serialVersionUID = 34L;
014    /**
015     * @param metaObject
016     * @param context
017     */
018    public PseudostateFacadeLogicImpl(
019        Pseudostate metaObject,
020        String context)
021    {
022        super(metaObject, context);
023    }
024
025    /**
026     * @see org.andromda.metafacades.uml.PseudostateFacade#isChoice()
027     */
028    @Override
029    protected boolean handleIsChoice()
030    {
031        return PseudostateKindEnum.PK_CHOICE.equals(metaObject.getKind());
032    }
033
034    /**
035     * @see org.andromda.metafacades.uml.PseudostateFacade#isInitialState()
036     */
037    @Override
038    protected boolean handleIsInitialState()
039    {
040        return PseudostateKindEnum.PK_INITIAL.equals(metaObject.getKind());
041    }
042
043    /**
044     * @see org.andromda.metafacades.uml.PseudostateFacade#isJoin()
045     */
046    @Override
047    protected boolean handleIsJoin()
048    {
049        return PseudostateKindEnum.PK_JOIN.equals(metaObject.getKind());
050    }
051
052    /**
053     * @see org.andromda.metafacades.uml.PseudostateFacade#isFork()
054     */
055    @Override
056    protected boolean handleIsFork()
057    {
058        return PseudostateKindEnum.PK_FORK.equals(metaObject.getKind());
059    }
060
061    /**
062     * @see org.andromda.metafacades.uml.PseudostateFacade#isJunction()
063     */
064    @Override
065    protected boolean handleIsJunction()
066    {
067        return PseudostateKindEnum.PK_JUNCTION.equals(metaObject.getKind());
068    }
069
070    /**
071     * @see org.andromda.metafacades.uml.PseudostateFacade#isDecisionPoint()
072     */
073    @Override
074    protected boolean handleIsDecisionPoint()
075    {
076        return (this.isChoice() || this.isJunction()) && metaObject.getOutgoing().size() > 1;
077    }
078
079    /**
080     * @see org.andromda.metafacades.uml.PseudostateFacade#isMergePoint()
081     */
082    @Override
083    protected boolean handleIsMergePoint()
084    {
085        return (this.isChoice() || this.isJunction()) && metaObject.getIncoming().size() > 1;
086    }
087
088    /**
089     * @see org.andromda.metafacades.uml.PseudostateFacade#isDeepHistory()
090     */
091    @Override
092    protected boolean handleIsDeepHistory()
093    {
094        return PseudostateKindEnum.PK_DEEP_HISTORY.equals(metaObject.getKind());
095    }
096
097    /**
098     * @see org.andromda.metafacades.uml.PseudostateFacade#isShallowHistory()
099     */
100    @Override
101    protected boolean handleIsShallowHistory()
102    {
103        return PseudostateKindEnum.PK_SHALLOW_HISTORY.equals(metaObject.getKind());
104    }
105
106    /**
107     * @see org.andromda.metafacades.uml.PseudostateFacade#isSplit()
108     */
109    @Override
110    protected boolean handleIsSplit()
111    {
112        return (this.isJoin() || this.isFork()) && metaObject.getOutgoing().size() > 1;
113    }
114
115    /**
116     * @see org.andromda.metafacades.uml.PseudostateFacade#isCollect()
117     */
118    @Override
119    protected boolean handleIsCollect()
120    {
121        return (this.isJoin() || this.isFork()) && metaObject.getIncoming().size() > 1;
122    }
123
124    /**
125     * @see org.andromda.metafacades.uml.PseudostateFacade#getValidationOwner()
126     */
127    @Override
128    public Object handleGetValidationOwner()
129    {
130        return this.getStateMachine();
131    }
132}