當前位置: 首頁>>代碼示例>>Java>>正文


Java EClass.getEStructuralFeature方法代碼示例

本文整理匯總了Java中org.eclipse.emf.ecore.EClass.getEStructuralFeature方法的典型用法代碼示例。如果您正苦於以下問題:Java EClass.getEStructuralFeature方法的具體用法?Java EClass.getEStructuralFeature怎麽用?Java EClass.getEStructuralFeature使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.emf.ecore.EClass的用法示例。


在下文中一共展示了EClass.getEStructuralFeature方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: visit

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
@Override
public void visit(ContainerValue containerval, String param) {
    Container container = (Container) containerval.getType();
    EClass containerClass = this.m_typeToEcore.getContainerClass(container);

    EObject containerObject = containerClass.getEPackage()
        .getEFactoryInstance()
        .create(containerClass);
    setElement(containerval, containerObject);
    this.m_eObjects.add(containerObject);

    EStructuralFeature eFeature = containerClass.getEStructuralFeature("value");
    @SuppressWarnings("unchecked") EList<Object> objectList =
        (EList<Object>) containerObject.eGet(eFeature);
    for (Value val : containerval.getValue()) {
        Object eSubValue = getElement(val);
        objectList.add(eSubValue);
    }
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:20,代碼來源:InstanceToEcore.java

示例2: getEAttribute

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
public EAttribute getEAttribute(String className, String attributeName) {
	EClassifier eClassifier = ePackage.getEClassifier(className);
	if (eClassifier instanceof EClass) {
		EClass eClass = (EClass)eClassifier;
		EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(attributeName);
		if (eStructuralFeature instanceof EAttribute) {
			return (EAttribute) eStructuralFeature;
		}
	}
	return null;
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:12,代碼來源:PackageMetaData.java

示例3: getEReference

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
public EReference getEReference(String className, String referenceName) {
	EClassifier eClassifier = ePackage.getEClassifier(className);
	if (eClassifier instanceof EClass) {
		EClass eClass = (EClass)eClassifier;
		EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(referenceName);
		if (eStructuralFeature instanceof EReference) {
			return (EReference) eStructuralFeature;
		}
	}
	return null;
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:12,代碼來源:PackageMetaData.java

示例4: getFeature

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
private Object getFeature(IdEObject origin, String featureName) {
	EClass eClass = origin.eClass();
	EStructuralFeature feature = eClass.getEStructuralFeature(featureName);
	if (feature != null) {
		return origin.eGet(feature);
	}
	return null;
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:9,代碼來源:MaterialGenerator.java

示例5: comparePrimitives

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
private int comparePrimitives(IdEObject o1, IdEObject o2) {
	EClass eClass = o1.eClass();
	EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature("wrappedValue");
	Object val1 = o1.eGet(eStructuralFeature);
	Object val2 = o2.eGet(eStructuralFeature);
	if (eStructuralFeature.getEType() == EcorePackage.eINSTANCE.getEString()) {
		return ((String) val1).compareTo((String) val2);
	} else if (eStructuralFeature.getEType() == EcorePackage.eINSTANCE.getEInt()) {
		return ((Integer) val1).compareTo((Integer) val2);
	} else {
		throw new RuntimeException("ni");
	}
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:14,代碼來源:IfcModel.java

示例6: writeEmbedded

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
private void writeEmbedded(EObject eObject) throws SerializerException, IOException {
	EClass class1 = eObject.eClass();
	print(getPackageMetaData().getUpperCase(class1));
	print(OPEN_PAREN);
	EStructuralFeature structuralFeature = class1.getEStructuralFeature(WRAPPED_VALUE);
	if (structuralFeature != null) {
		Object realVal = eObject.eGet(structuralFeature);
		if (structuralFeature.getEType() == ECORE_PACKAGE_INSTANCE.getEDouble()) {
			writeDoubleValue((Double)realVal, eObject, structuralFeature);
		} else {
			IfcParserWriterUtils.writePrimitive(realVal, outputStream);
		}
	}
	print(CLOSE_PAREN);
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:16,代碼來源:IfcStepSerializer.java

示例7: createInitialModel

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
/**
 * Create a new model.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected EObject createInitialModel ()
{
    EClass eClass = ExtendedMetaData.INSTANCE.getDocumentRoot ( configurationPackage );
    EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature ( initialObjectCreationPage.getInitialObjectName () );
    EObject rootObject = configurationFactory.create ( eClass );
    rootObject.eSet ( eStructuralFeature, EcoreUtil.create ( (EClass)eStructuralFeature.getEType () ) );
    return rootObject;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:15,代碼來源:ConfigurationModelWizard.java

示例8: visitTypesFacet

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
/**
 * Constructor types or annotation types from the given {@link RAMLParser.TypesFacetContext}.
 *
 * @param typesFacet the types/annotation types facet
 * @return list of types/annotation types
 */
@Override
public Object visitTypesFacet(final RAMLParser.TypesFacetContext typesFacet) {
    final String typesReferenceName = typesFacet.facet.getText();
    final EClass eClass = scope.eObject().eClass();
    final EStructuralFeature typesFeature = eClass.getEStructuralFeature(typesReferenceName);

    return withinScope(scope.with(typesFeature), typesScope -> {
        final List<Object> types = typesFacet.types.stream()
                .map(this::visitTypeDeclarationFacet)
                .collect(Collectors.toList());

        return types;
    });
}
 
開發者ID:vrapio,項目名稱:rest-modeling-framework,代碼行數:21,代碼來源:AbstractConstructor.java

示例9: visitTypesFacet

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
@Override
public Object visitTypesFacet(final RAMLParser.TypesFacetContext typesFacet) {
    final String typesReferenceName = typesFacet.facet.getText();
    final EClass eClass = scope.eObject().eClass();
    final EStructuralFeature typesFeature = eClass.getEStructuralFeature(typesReferenceName);

    return withinScope(scope.with(typesFeature), typesScope -> {
        final List<Object> types = typesFacet.types.stream()
                .map(this::visitTypeDeclarationFacet)
                .collect(Collectors.toList());

        return types;
    });
}
 
開發者ID:vrapio,項目名稱:rest-modeling-framework,代碼行數:15,代碼來源:TypeDeclarationResolver.java

示例10: TypeExpressionBuilder

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
public TypeExpressionBuilder(final Scope scope, final EClass arrayTypeDeclarationType) {
    this.scope = scope;
    this.arrayTypeDeclarationType = arrayTypeDeclarationType;
    this.itemsFeature = arrayTypeDeclarationType.getEStructuralFeature("items");
}
 
開發者ID:vrapio,項目名稱:rest-modeling-framework,代碼行數:6,代碼來源:TypeExpressionConstructor.java


注:本文中的org.eclipse.emf.ecore.EClass.getEStructuralFeature方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。