Object eGet = eObject.eGet(eStructuralFeature); if (eStructuralFeature instanceof EAttribute) { if (eStructuralFeature.getUpperBound() == 1) { out.println("<td>" + eGet + "</td>"); } else { if (eStructuralFeature.getUpperBound() == 1) { if (eStructuralFeature.getEType().getEAnnotation("wrapped") != null) { EObject value = (EObject) eGet;
@SuppressWarnings("unchecked") public void sortAllAggregates(ObjectIDM objectIDM, IdEObject ifcRoot) { for (EStructuralFeature eStructuralFeature : ifcRoot.eClass().getEAllStructuralFeatures()) { if (objectIDM.shouldFollowReference(ifcRoot.eClass(), ifcRoot.eClass(), eStructuralFeature)) { if (eStructuralFeature.getUpperBound() == -1 || eStructuralFeature.getUpperBound() > 1) { if (eStructuralFeature.getEType() instanceof EClass) { if (eStructuralFeature.getEType().getEAnnotation("wrapped") != null) { EList<IdEObject> list = (EList<IdEObject>) ifcRoot.eGet(eStructuralFeature); sortPrimitiveList(list); } else { EList<IdEObject> list = (EList<IdEObject>) ifcRoot.eGet(eStructuralFeature); sortComplexList(objectIDM, ifcRoot.eClass(), list, eStructuralFeature); } } } } } }
protected boolean shouldUnset(EStructuralFeature feature, Object value) { if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY && !feature.isUnsettable()) { Object defaultValue = feature.getDefaultValue(); return defaultValue == null ? value == null : defaultValue.equals(value); } else { return false; } }
protected boolean shouldUnset(EStructuralFeature feature, Object value) { if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY && !feature.isUnsettable()) { Object defaultValue = feature.getDefaultValue(); return defaultValue == null ? value == null : defaultValue.equals(value); } else { return false; } }
/** * <!-- begin-user-doc --> * Indicates whether the contents of this Slot can fit in the * specified EStructuralFeature. * <!-- end-user-doc --> * @model * @generated NOT */ public boolean multiplicityCompatibleWith(EStructuralFeature feature) { return getNumberOfValues() >= feature.getLowerBound() && getNumberOfValues() <= feature.getUpperBound(); }
else if (feature.getUpperBound() == ETypedElement.UNSPECIFIED_MULTIPLICITY) int affiliationUpperBound = affiliation.getUpperBound(); return (affiliationUpperBound > 1 || affiliationUpperBound == ETypedElement.UNBOUNDED_MULTIPLICITY) &&
else if (feature.getUpperBound() == ETypedElement.UNSPECIFIED_MULTIPLICITY) int affiliationUpperBound = affiliation.getUpperBound(); return (affiliationUpperBound > 1 || affiliationUpperBound == ETypedElement.UNBOUNDED_MULTIPLICITY) &&
protected EList<?> getListValue(EList<?> originalList) { if (isSet() && getFeature().getUpperBound() != 1) { if (value instanceof EList<?>) // cached already? { return (EList<?>)value; } EList<Object> changedList = new BasicEList<Object>(originalList); apply(changedList); value = changedList; // cache result return changedList; } return ECollections.EMPTY_ELIST; }
protected boolean shouldUnset(EStructuralFeature feature, Object value) { // If the feature is unsettable, then regardless of the value, we should not be unsetting the feature. // if (feature.isUnsettable()) { return false; } // If it's not an open content element, unset the feature if the value is the same as the default value. // else if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY) { Object defaultValue = feature.getDefaultValue(); return defaultValue == null ? value == null : defaultValue.equals(value); } // If this is a feature of the document root itself, unset if the value is null. // If it was a nillable element, it would have been unsettable. // else if (feature.getEContainingClass() == owner.eClass()) { return value == null; } // Otherwise, return false. // else { return false; } }
protected EList<?> getListValue(EList<?> originalList) { if (isSet() && getFeature().getUpperBound() != 1) { if (value instanceof EList<?>) // cached already? { return (EList<?>)value; } EList<Object> changedList = new BasicEList<Object>(originalList); apply(changedList); value = changedList; // cache result return changedList; } return ECollections.EMPTY_ELIST; }
protected boolean shouldUnset(EStructuralFeature feature, Object value) { // If the feature is unsettable, then regardless of the value, we should not be unsetting the feature. // if (feature.isUnsettable()) { return false; } // If it's not an open content element, unset the feature if the value is the same as the default value. // else if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY) { Object defaultValue = feature.getDefaultValue(); return defaultValue == null ? value == null : defaultValue.equals(value); } // If this is a feature of the document root itself, unset if the value is null. // If it was a nillable element, it would have been unsettable. // else if (feature.getEContainingClass() == owner.eClass()) { return value == null; } // Otherwise, return false. // else { return false; } }
protected XSDParticle buildModelGroupParticle(XSDComplexTypeDefinition xsdComplexTypeDefinition, EStructuralFeature eStructuralFeature) { XSDModelGroup xsdModelGroup = findOrCreateModelGroup(xsdComplexTypeDefinition); XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL); XSDParticle xsdParticle = XSDFactory.eINSTANCE.createXSDParticle(); xsdParticle.setContent(modelGroup); if (eStructuralFeature.getUpperBound() != 1) { xsdParticle.setMaxOccurs(eStructuralFeature.getUpperBound()); } xsdModelGroup.getContents().add(xsdParticle); map(xsdParticle, eStructuralFeature); createEcoreAnnotation(xsdParticle, "featureMap", eStructuralFeature.getName()); buildAnnotations(xsdModelGroup, eStructuralFeature); return xsdParticle; }
protected XSDParticle buildModelGroupParticle(XSDComplexTypeDefinition xsdComplexTypeDefinition, EStructuralFeature eStructuralFeature) { XSDModelGroup xsdModelGroup = findOrCreateModelGroup(xsdComplexTypeDefinition); XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL); XSDParticle xsdParticle = XSDFactory.eINSTANCE.createXSDParticle(); xsdParticle.setContent(modelGroup); if (eStructuralFeature.getUpperBound() != 1) { xsdParticle.setMaxOccurs(eStructuralFeature.getUpperBound()); } xsdModelGroup.getContents().add(xsdParticle); map(xsdParticle, eStructuralFeature); createEcoreAnnotation(xsdParticle, "featureMap", eStructuralFeature.getName()); buildAnnotations(xsdModelGroup, eStructuralFeature); return xsdParticle; }
int upperBound = feature.getUpperBound(); if (upperBound > 0 && size > upperBound)
if (referencedObject != null) if (structuralFeature.getUpperBound() != -1)
if (eStructuralFeature.getUpperBound() != 1) xsdParticle.setMaxOccurs(eStructuralFeature.getUpperBound());
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public Object getValue() { EStructuralFeature feature = getFeature(); if (feature.getUpperBound() != 1) { if (value == null && eContainer() instanceof EObjectToChangesMapEntryImpl) { value = getListValue((EList<?>)((EObjectToChangesMapEntryImpl)eContainer()).getTypedKey().eGet(feature)); } } else if (feature instanceof EReference) { return getReferenceValue(); } else if (value == null) // feature is instance of EAttribute { EDataType type = (EDataType)feature.getEType(); value = EcoreUtil.createFromString(type, valueString); } return value; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public Object getValue() { EStructuralFeature feature = getFeature(); if (feature.getUpperBound() != 1) { if (value == null && eContainer() instanceof EObjectToChangesMapEntryImpl) { value = getListValue((EList<?>)((EObjectToChangesMapEntryImpl)eContainer()).getTypedKey().eGet(feature)); } } else if (feature instanceof EReference) { return getReferenceValue(); } else if (value == null) // feature is instance of EAttribute { EDataType type = (EDataType)feature.getEType(); value = EcoreUtil.createFromString(type, valueString); } return value; }
int upperBound = openFeature.getUpperBound(); if (upperBound > 1 || upperBound == ETypedElement.UNBOUNDED_MULTIPLICITY)
int upperBound = openFeature.getUpperBound(); if (upperBound > 1 || upperBound == ETypedElement.UNBOUNDED_MULTIPLICITY)