Package org.andromda.cartridges.meta.metafacades

Source Code of org.andromda.cartridges.meta.metafacades.PSMmetaclassLogicImpl

package org.andromda.cartridges.meta.metafacades;

import java.util.Iterator;

import org.andromda.metafacades.uml.OperationFacade;

/**
* MetafacadeLogic implementation for
* org.andromda.cartridges.meta.metafacades.PSMmetaclass.
*
* @see org.andromda.cartridges.meta.metafacades.PSMmetaclass
*/
public class PSMmetaclassLogicImpl extends PSMmetaclassLogic
{

    public PSMmetaclassLogicImpl(Object metaObject, String context)
    {
        super(metaObject, context);
    }

    /**
     * @see org.andromda.cartridges.meta.metafacades.PSMmetaclass#isOperationsPresent()
     */
    protected boolean handleIsOperationsPresent()
    {
        return this.getOperations().size() > 0;
    }

    /*
     * (non-Javadoc)
     *
     * @see org.andromda.cartridges.meta.metafacades.PSMmetaclassLogic#handleIsImplMustBeAbstract()
     */
    protected boolean handleIsImplMustBeAbstract()
    {
        boolean result = false;

        // if the class itself is abstract, make the impl abstract, too.
        if (this.isAbstract())
        {
            result = true;
        }
        else
        {
            // if the class contains abstract operations, the impl must be
            // abstract, too, because the abstract operations will not be
            // generated as methods.
            for (Iterator iter = this.getOperations().iterator(); iter.hasNext();)
            {
                OperationFacade operation = (OperationFacade) iter.next();
                if (operation.isAbstract())
                {
                    result = true;
                    break;
                }
            }
        }
        return result;
    }

}
TOP

Related Classes of org.andromda.cartridges.meta.metafacades.PSMmetaclassLogicImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.