本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
}
示例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);
}
示例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;
}
示例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;
});
}
示例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;
});
}
示例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");
}