public List<Constraint> getMessageParameterConstraints(final MessageParameter parameter) { final SourceReference ref = parameter.getSourceReference(); boolean _matched = false; if (ref instanceof PropertyReference) { _matched=true; final Function1<PropertyRealization, Boolean> _function = (PropertyRealization it) -> { Feature _baseProperty = it.getBaseProperty(); PrimitiveProperty _conceptualFeature = ((PropertyReference)ref).getConceptualFeature(); return Boolean.valueOf(Objects.equal(_baseProperty, _conceptualFeature)); }; PropertyRealization property = IterableExtensions.<PropertyRealization>findFirst(parameter.getContainingMessage().getIncludedProperties(), _function); if ((property == null)) { return ((PropertyReference)ref).getConceptualFeature().getAllConstraints(); } return property.getAllConstraints(); } return null; }
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()); } } } }
PrimitiveProperty newPrimitiveProperty = RapidmlFactory.eINSTANCE.createPrimitiveProperty(); newPrimitiveProperty.setType(inheritedPrimitiveProperty.getType()); List<Constraint> constraintsToCopy = Lists.newArrayList(inheritedPrimitiveProperty.getAllConstraints()); for (PrimitiveProperty nextInheritedProperty : Iterables.filter(inheritedPropertiesForName, PrimitiveProperty.class)) { constraintsToCopy.addAll(nextInheritedProperty.getAllConstraints()); newPrimitiveProperty.getAllConstraints().add(newConstraint);
private CharSequence _generatePropertyType(final PrimitiveProperty property) { StringConcatenation _builder = new StringConcatenation(); { if (((property.getType() instanceof Enumeration) || (property.getType() instanceof UserDefinedType))) { _builder.append("<a href=\"#"); String _htmlLink = this.docHelper.htmlLink(property.getType()); _builder.append(_htmlLink); _builder.append("\">"); String _generateFeatureType = this.generateFeatureType(property); _builder.append(_generateFeatureType); _builder.append("</a>"); _builder.newLineIfNotEmpty(); } else { String _generateFeatureType_1 = this.generateFeatureType(property); _builder.append(_generateFeatureType_1); _builder.newLineIfNotEmpty(); } } CharSequence _generateInlineConstraints = this.docHelper.generateInlineConstraints(property.getAllConstraints()); _builder.append(_generateInlineConstraints); _builder.newLineIfNotEmpty(); return _builder; }