当前位置: 首页>>代码示例>>Java>>正文


Java EClass.setName方法代码示例

本文整理汇总了Java中org.eclipse.emf.ecore.EClass.setName方法的典型用法代码示例。如果您正苦于以下问题:Java EClass.setName方法的具体用法?Java EClass.setName怎么用?Java EClass.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.emf.ecore.EClass的用法示例。


在下文中一共展示了EClass.setName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
@Override
public void visit(Tuple tuple, String param) {
    if (hasElement(tuple)) {
        return;
    }

    EPackage firstRoot = this.m_rootPackages.iterator()
        .next();
    EClass eClass = g_EcoreFactory.createEClass();
    setElement(tuple, eClass);

    eClass.setName(getTupleName(tuple));

    firstRoot.getEClassifiers()
        .add(eClass);

    int typeIndex = 1;
    for (Type type : tuple.getTypes()) {
        Field typeField =
            new Field(Name.getName(getTupleElementName(tuple, typeIndex++)), type, 1, 1);
        EStructuralFeature eStructFeat = (EStructuralFeature) getElement(typeField);
        eClass.getEStructuralFeatures()
            .add(eStructFeat);
    }
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:26,代码来源:TypeToEcore.java

示例2: createArrayType

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
private EClass createArrayType(ArrayType arrayType) {
	//System.out.println("maaaaap " + occiType2emfType);
	EClass type = EcoreFactory.eINSTANCE.createEClass();
	type.setName(arrayType.getName());
	if (arrayType.getDocumentation() != null) {
		attachInfo(type, arrayType.getDocumentation());
	}
	return type;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:10,代码来源:OCCIExtension2Ecore.java

示例3: createRecordType

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
private EClass createRecordType(RecordType recordType) {
	//System.out.println("maaaaap " + occiType2emfType);
	EClass type = EcoreFactory.eINSTANCE.createEClass();
	type.setName(recordType.getName());
	if (recordType.getDocumentation() != null) {
		attachInfo(type, recordType.getDocumentation());
	}
	return type;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:10,代码来源:OCCIExtension2Ecore.java

示例4: convertKind

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
/**
 * Convert an OCCI kind to an Ecore class.
 * 
 * @param kind
 *            the OCCI kind to convert.
 * @return the resulting Ecore class.
 */
protected EClass convertKind(Kind kind) {
	// Create the Ecore class.
	EClass eClass = EcoreFactory.eINSTANCE.createEClass();
	// Set the name of the Ecore class.
	eClass.setName(ConverterUtils.toU1Case(ConverterUtils.formatName(kind.getTerm())));
	// Convert all attributes of the OCCI kind.
	for (Attribute attribute : kind.getAttributes()) {
		// Convert each OCCI attribute to an Ecore attribute.
		EStructuralFeature convertAttribute = convertAttribute(attribute);
		if (convertAttribute != null) {
			// Add the Ecore attribute as a structural feature of the Ecore
			// class.
			eClass.getEStructuralFeatures().add(convertAttribute);
		}
	}
	// Convert all actions of the OCCI kind.
	for (Action action : kind.getActions()) {
		// Convert each OCCI action to an Ecore operation.
		EOperation convertAction = convertAction(action);
		if (convertAction != null) {
			// Add the Ecore action as an operation of the Ecore class.
			eClass.getEOperations().add(convertAction);
		}
	}
	attachInfo(eClass, kind.getTitle());
	// Keep the Ecore class into a cache to search it later.
	occiKind2emfEclass.put(kind, eClass);

	// Convert all constraints of the OCCI kind.
	convertConstraints(eClass, kind);
	
	if(kind.getSource().size() > 0){
		addSourceConstraint(kind, eClass);
	}
	if(kind.getTarget().size() > 0){
		addTargetConstraint(kind, eClass);
	}
	return eClass;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:47,代码来源:OCCIExtension2Ecore.java

示例5: ecl

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
private EClass ecl(String n) {
	EClass c = EcoreFactory.eINSTANCE.createEClass();
	c.setName(n);
	return c;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:6,代码来源:EcoreUtilN4Test.java


注:本文中的org.eclipse.emf.ecore.EClass.setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。