当前位置: 首页>>代码示例>>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;未经允许,请勿转载。