當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。