private void processPropertyOverride(Feature declaredProperty, Iterable<Feature> overriddenPropertyHierarchy) { if (declaredProperty instanceof PrimitiveProperty) { PrimitiveProperty declaredPrimitiveProperty = (PrimitiveProperty) declaredProperty; for (PrimitiveProperty overriddenProperty : Iterables.filter(overriddenPropertyHierarchy, PrimitiveProperty.class)) { EList<Constraint> constraintsToCopy = overriddenProperty.getAllConstraints(); for (Constraint next : constraintsToCopy) { Constraint newConstraint = EcoreUtil.copy(next); declaredPrimitiveProperty.getAllConstraints().add(newConstraint); } } } if (declaredProperty.getDocumentation() == null) { for (Feature next : overriddenPropertyHierarchy) { if (next.getDocumentation() != null) { Documentation documentation = RapidmlFactory.eINSTANCE.createDocumentation(); documentation.setText(next.getDocumentation().getText()); declaredProperty.setDocumentation(documentation); } } } if (declaredProperty.getCardinality() == null) { for (Feature next : overriddenPropertyHierarchy) { if (next.getCardinality() != null) { declaredProperty.setCardinality(next.getCardinality()); } } } }
private String generateFeatureType(final Feature feature) { StringConcatenation _builder = new StringConcatenation(); String _featureType = this.paramHelper.featureType(feature, this.importHelper); _builder.append(_featureType); _builder.newLineIfNotEmpty(); { int[] _cardinality = feature.getCardinality(); boolean _tripleNotEquals = (_cardinality != null); if (_tripleNotEquals) { String _prettyPrintedMultiplicity = this.commonServices.getPrettyPrintedMultiplicity(feature); _builder.append(_prettyPrintedMultiplicity); } } _builder.newLineIfNotEmpty(); return _builder.toString(); }
newProperty.setCardinality(inheritedProperty.getCardinality()); newProperty.setReadOnly(inheritedProperty.isReadOnly()); newProperty.setKey(inheritedProperty.isKey());