/** * Checks if the referenceTreatment type is not null. * * @return the predicate */ public static java.util.function.Predicate<ReferenceTreatment> hasDeclaredType() { return input -> { if (null != input) { ReferenceElement reference = input.getReferenceElement(); return reference != null && null != reference.getDataType(); } return false; }; }
public static String getLabel(ReferenceElement referenceElement) { return ">" + referenceElement.getName(); }
public Cardinality getCardinality(ReferenceElement property) { Cardinality cardinality = getCardinality(property.getMinOccurs(), property.getMaxOccurs()); return cardinality; }
_builder.newLineIfNotEmpty(); _builder.append(" "); String _name = referencedProperty.getName(); _builder.append(_name, " "); _builder.append(" "); _builder.append(" "); _builder.append("<a href=\"#"); String _htmlLink = this.docHelper.htmlLink(referencedProperty.getDataType()); _builder.append(_htmlLink, " "); _builder.append("\">"); String _qualifiedName = this.importHelper.getQualifiedName(referencedProperty.getDataType()); _builder.append(_qualifiedName, " "); _builder.append("</a>");
private Iterable<String> getReferenceXpath(final ReferenceElement refProperty) { LinkedList<String> _xblockexpression = null; { LinkedList<String> result = new LinkedList<String>(); boolean _isMultiValued = refProperty.isMultiValued(); if (_isMultiValued) { String _listElementName = this.traceHelper.getListElementName(refProperty); result.add(_listElementName); String _listItemElementName = this.traceHelper.getListItemElementName(refProperty); result.add(_listItemElementName); } else { String _elementName = this.traceHelper.getElementName(refProperty); result.add(_elementName); } _xblockexpression = result; } return _xblockexpression; }
private boolean isMultivalued(final ReferenceTreatment treatment) { boolean _xblockexpression = false; { int _maxOccurs = treatment.getReferenceElement().getMaxOccurs(); final boolean propIsMulti = (_maxOccurs < 0); boolean _switchResult = false; boolean _matched = false; if (treatment instanceof ReferenceLink) { _matched=true; _switchResult = (propIsMulti && (((ReferenceLink)treatment).getTargetResource() instanceof ObjectResource)); } if (!_matched) { if (treatment instanceof ReferenceEmbed) { _matched=true; _switchResult = propIsMulti; } } _xblockexpression = _switchResult; } return _xblockexpression; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public com.reprezen.rapidml.ReferenceElement getReferenceElement() { if (referenceElement != null && referenceElement.eIsProxy()) { InternalEObject oldReferenceElement = (InternalEObject)referenceElement; referenceElement = (com.reprezen.rapidml.ReferenceElement)eResolveProxy(oldReferenceElement); if (referenceElement != oldReferenceElement) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, RapidmlPackage.REFERENCE_TREATMENT__REFERENCE_ELEMENT, oldReferenceElement, referenceElement)); } } return referenceElement; }
try { StringConcatenation _builder = new StringConcatenation(); String _name = treatment.getReferenceElement().getName(); _builder.append(_name); _builder.append(": {"); _builder.append("\t"); _builder.append("type: \'"); String _name_1 = treatment.getReferenceElement().getDataType().getName(); _builder.append(_name_1, "\t"); _builder.append("\',");
private Iterable<String> getContainmentXpath(final ReferenceElement refProperty) { LinkedList<String> _xblockexpression = null; { LinkedList<String> result = new LinkedList<String>(); boolean _isMultiValued = refProperty.isMultiValued(); if (_isMultiValued) { String _listElementName = this.traceHelper.getListElementName(refProperty); result.add(_listElementName); String _listItemElementName = this.traceHelper.getListItemElementName(refProperty); result.add(_listItemElementName); } else { String _elementName = this.traceHelper.getElementName(refProperty); result.add(_elementName); } _xblockexpression = result; } return _xblockexpression; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public com.reprezen.rapidml.ReferenceElement getReferenceElement() { if (referenceElement != null && referenceElement.eIsProxy()) { InternalEObject oldReferenceElement = (InternalEObject)referenceElement; referenceElement = (com.reprezen.rapidml.ReferenceElement)eResolveProxy(oldReferenceElement); if (referenceElement != oldReferenceElement) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, RapidmlPackage.PATH_SEGMENT__REFERENCE_ELEMENT, oldReferenceElement, referenceElement)); } } return referenceElement; }
public static Structure getContextDataType(EObject context) { if (context instanceof ServiceDataResource) { return ((ServiceDataResource) context).getDataType(); } if (context instanceof TypedMessage) { return ((TypedMessage) context).getActualType(); } if (context instanceof ReferenceTreatment) { return ((ReferenceTreatment) context).getReferenceElement().getDataType(); } // not supported case return null; }
private String getReferenceTreatmentName(final ReferenceTreatment aReferenceLink) { return aReferenceLink.getReferenceElement().getName(); }
public CollectionRealizationLevelEnum getCollectionRealizationLevel() { if (!eIsSet(RapidmlPackage.REFERENCE_LINK__COLLECTION_REALIZATION_LEVEL)) { boolean isCollectionLevel = getReferenceElement().isMultiValued() && (getTargetResource() instanceof CollectionResource); setCollectionRealizationLevel(isCollectionLevel ? CollectionRealizationLevelEnum.COLLECTION_LEVEL : CollectionRealizationLevelEnum.ITEM_LEVEL); } return getCollectionRealizationLevelGen(); }
IScope scope_ReferenceTreatment_referenceElement(ReferenceTreatment referenceTreatment, EReference eRef) { EObject econtainer = referenceTreatment.eContainer(); final Structure contextDataType; if (econtainer instanceof ReferenceEmbed) { contextDataType = ((ReferenceEmbed) econtainer).getReferenceElement().getDataType(); } else if (econtainer instanceof ReferenceRealization) { contextDataType = ((ReferenceTreatment) ((ReferenceRealization) econtainer).eContainer()) .getReferenceElement().getDataType(); } else if (econtainer instanceof TypedMessage) { contextDataType = ((TypedMessage) econtainer).getActualType(); } else { contextDataType = ((RealizationContainer) econtainer).getDataType(); } Iterable<ReferenceProperty> result = Iterables.filter(getAllFeatures(contextDataType), ReferenceProperty.class); if (referenceTreatment instanceof ReferenceLink) { // leave only containment references, containment reference might // not be supported in WADL/XSD generator // result = filter(result, isContainmentReferenceProperty()); } return Scopes.scopeFor(result); }
private String getParameterName(final ReferenceLink referenceLink) { return StringExtensions.toFirstLower(referenceLink.getReferenceElement().getName()); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @NOT-generated */ @Override public Structure getDataType() { Structure result = super.getDataType(); if (result != null) { return result; } if (eContainer() instanceof ReferenceTreatment && ((ReferenceTreatment)eContainer()).getReferenceElement() != null) { return ((ReferenceTreatment)eContainer()).getReferenceElement().getDataType(); } return null; }
private List<PropertyRealization> getEnrichmentProperties(final TypedResponse response) { ResourceDefinition _resourceType = response.getResourceType(); final ServiceDataResource resource = ((ServiceDataResource) _resourceType); ResourceDefinition _resourceType_1 = response.getResourceType(); boolean _tripleNotEquals = (_resourceType_1 != null); if (_tripleNotEquals) { final Function1<ReferenceTreatment, Boolean> _function = (ReferenceTreatment it) -> { return Boolean.valueOf(((it instanceof ReferenceLink) && Objects.equal(it.getReferenceElement().getName(), "ObjectResourceLink"))); }; final ReferenceTreatment orLink = IterableExtensions.<ReferenceTreatment>head(IterableExtensions.<ReferenceTreatment>filter(resource.getAllReferenceTreatments(), _function)); if ((orLink != null)) { return Collections.<PropertyRealization>unmodifiableList(CollectionLiterals.<PropertyRealization>newArrayList()); } else { ResourceDefinition _resourceType_2 = response.getResourceType(); return ((ServiceDataResource) _resourceType_2).getProperties().getAllIncludedProperties(); } } else { return response.getProperties().getAllIncludedProperties(); } }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public com.reprezen.rapidml.Structure getDataType() { if (eContainer() instanceof ServiceDataResource) { return ((ServiceDataResource) eContainer()).getDataType(); } if (eContainer() instanceof TypedMessage) { return ((TypedMessage) eContainer()).getActualType(); } if (eContainer() instanceof ReferenceRealization) { ReferenceRealization realization = (ReferenceRealization) eContainer(); ReferenceTreatment treatment = realization != null ? (ReferenceTreatment) realization.eContainer() : null; return treatment != null ? treatment.getReferenceElement().getDataType() : null; } if (eContainer() instanceof ReferenceTreatment) { return ((ReferenceTreatment) eContainer()).getReferenceElement().getDataType(); } return null; }
_builder.newLineIfNotEmpty(); _builder.append(" "); String _name = referencedProperty.getName(); _builder.append(_name, " "); _builder.newLineIfNotEmpty();
_builder.append(_referenceTreatmentName, " "); _builder.append(" : "); String _name = ref.getReferenceElement().getDataType().getName(); _builder.append(_name, " "); String _cardinalityLabel = com.reprezen.genflow.common.xtend.XDataTypeExtensions.getCardinalityLabel(ref, resource.getIncludedProperties());