OCCIExtension2Ecore.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:OCCI-Studio 作者:
/**
 * Convert an OCCI action to an Ecore operation.
 * 
 * @param action
 *            the OCCI action to convert.
 * @return the resulting Ecore operation.
 */
protected EOperation convertAction(Action action) {
    // Create the Ecore operation.
    EOperation eOperation = EcoreFactory.eINSTANCE.createEOperation();
    // Set the name of the Ecore operation.
    eOperation.setName(ConverterUtils.formatName(action.getTerm()));
    // Convert all attributes of the OCCI action.
    for (Attribute attribute : action.getAttributes()) {
        // Each OCCI attribute of the OCCI action is converted to an Ecore
        // parameter of the Ecore operation.
        EParameter convertParameter = convertParameter(attribute);
        if (convertParameter != null) {
            // Add the Ecore parameter to the Ecore operation.
            eOperation.getEParameters().add(convertParameter);
        }
    }
    attachInfo(eOperation, action.getTitle());

    return eOperation;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号