001package org.andromda.metafacades.uml14;
002
003import org.andromda.metafacades.uml.AttributeFacade;
004import org.andromda.metafacades.uml.ClassifierFacade;
005import org.andromda.metafacades.uml.EntityAttribute;
006import org.andromda.metafacades.uml.ManageableEntity;
007
008/**
009 * MetafacadeLogic implementation for org.andromda.metafacades.uml.ManageableEntityAssociationEnd.
010 *
011 * @see org.andromda.metafacades.uml.ManageableEntityAssociationEnd
012 * @author Bob Fields
013 */
014public class ManageableEntityAssociationEndLogicImpl
015    extends ManageableEntityAssociationEndLogic
016{
017    private static final long serialVersionUID = -4698233249137350091L;
018
019    /**
020     * @param metaObject
021     * @param context
022     */
023    public ManageableEntityAssociationEndLogicImpl(Object metaObject, String context)
024    {
025        super(metaObject, context);
026    }
027
028    /**
029     * @see org.andromda.metafacades.uml.ManageableEntityAssociationEnd#getManageableIdentifier()
030     */
031    @Override
032    protected EntityAttribute handleGetManageableIdentifier()
033    {
034        AttributeFacade manageableIdentifier = null;
035
036        final ClassifierFacade classifierFacade = this.getType();
037        if (classifierFacade instanceof ManageableEntity)
038        {
039            final ManageableEntity entity = (ManageableEntity)classifierFacade;
040            manageableIdentifier = entity.getManageableIdentifier();
041        }
042
043        return (EntityAttribute)manageableIdentifier;
044    }
045
046    /**
047     * @see org.andromda.metafacades.uml.ManageableEntityAssociationEnd#isDisplay()
048     */
049    @Override
050    protected boolean handleIsDisplay()
051    {
052        // we always display association ends
053        return true;
054    }
055}