private Structure getResourceDataType(final ResourceDefinition resource) { Structure _switchResult = null; boolean _matched = false; if (resource instanceof ServiceDataResource) { _matched=true; _switchResult = ((ServiceDataResource)resource).getDataType(); } return _switchResult; }
private String _getURISegmentId(final ServiceDataResource aResource, final MatrixParameter param) { String _name = aResource.getName(); String _plus = (_name + ".URI."); int _size = aResource.getURI().getSegments().size(); int _indexOf = this.getMatrixParameters(aResource).indexOf(param); int _plus_1 = (_size + _indexOf); int _plus_2 = (_plus_1 + 1); return (_plus + Integer.valueOf(_plus_2)); }
private CharSequence generateReferenceTreatments(final ServiceDataResource resource) { StringConcatenation _builder = new StringConcatenation(); { EList<ReferenceTreatment> _referenceTreatments = resource.getReferenceTreatments(); for(final ReferenceTreatment refTreatment : _referenceTreatments) { EList<PropertyRealization> _includedProperties = resource.getIncludedProperties(); CycleDetector<ReferenceTreatment> _cycleDetector = new CycleDetector<ReferenceTreatment>(); String _generateReferenceTreatment = this.generateReferenceTreatment(refTreatment, _includedProperties, _cycleDetector, Integer.valueOf(0)); _builder.append(_generateReferenceTreatment); _builder.newLineIfNotEmpty(); } } return _builder; }
_builder.append(_htmlLink); _builder.append("\" data-zenname=\""); String _name = resource.getName(); _builder.append(_name); _builder.append("\"></a>"); String _name_1 = resource.getName(); _builder.append(_name_1, " "); _builder.append(" <code>"); URI _uRI = resource.getURI(); _builder.append(_uRI, " "); _builder.append("</code> "); _builder.newLineIfNotEmpty(); Structure _dataType = resource.getDataType(); boolean _tripleNotEquals = (_dataType != null); if (_tripleNotEquals) { _builder.append(" "); _builder.append("<span class=\"glyphicon glyphicon-arrow-right\"></span> <code>"); String _qualifiedName = this.importHelper.getQualifiedName(resource.getDataType()); _builder.append(_qualifiedName, " "); _builder.append("</code>"); boolean _isDefault = resource.isDefault(); if (_isDefault) { _builder.append(" "); _builder.newLine(); _builder.append(" ");
_builder.newLine(); _builder.append("class "); String _name = this.resource.getName(); _builder.append(_name); _builder.append(" extends Resource {"); _builder.newLineIfNotEmpty(); EList<Method> _methods = this.resource.getMethods(); for(final Method method : _methods) { _builder.append("\t\t"); _builder.append(_lowerCase, "\t\t"); _builder.append("(`${app.locals.basePath}"); String _expressify = this.expressify(this.resource.getURI()); _builder.append(_expressify, "\t\t"); _builder.append("`, this."); EList<Method> _methods_1 = this.resource.getMethods(); boolean _hasElements = false; for(final Method method_1 : _methods_1) { _builder.newLine(); _builder.append("module.exports = "); String _name_1 = this.resource.getName(); _builder.append(_name_1); _builder.append(";");
_builder.append(" "); _builder.append("\"id\": \""); String _name_1 = resource.getName(); _builder.append(_name_1, " "); _builder.append("."); return Boolean.valueOf(resource.isIncluded(e)); }; Iterable<PrimitiveProperty> _filter = IterableExtensions.<PrimitiveProperty>filter(Iterables.<PrimitiveProperty>filter(resource.getDataType().getOwnedFeatures(), PrimitiveProperty.class), _function); boolean _hasElements = false; for(final PrimitiveProperty feature : _filter) { _builder.newLine(); EList<ReferenceTreatment> _referenceTreatments = resource.getReferenceTreatments(); boolean _hasElements_1 = false; for(final ReferenceTreatment aReferenceTreatment : _referenceTreatments) {
_builder.append(" "); _builder.append("\"name\": \""); String _name = aResource.getName(); _builder.append(_name, " "); _builder.append("\","); _builder.append(" "); _builder.append("\"id\": \""); String _name_1 = aResource.getName(); _builder.append(_name_1, " "); _builder.append("\","); com.reprezen.rapidml.URI _uRI = aResource.getURI(); boolean _tripleNotEquals = (_uRI != null); if (_tripleNotEquals) { EList<URISegment> _segments = aResource.getURI().getSegments(); boolean _hasElements = false; for(final URISegment segment : _segments) { if (((!aResource.getURI().getSegments().isEmpty()) && (!matrixParams.isEmpty()))) { _builder.append(","); if ((((!this.getMatrixParameters(aResource).isEmpty()) || (!aResource.getURI().getSegments().isEmpty())) && (!params.isEmpty()))) { _builder.append(","); com.reprezen.rapidml.URI _uRI_1 = aResource.getURI(); boolean _tripleNotEquals_1 = (_uRI_1 != null);
private String referenceTreatmentIdPath(final ReferenceTreatment ref, final ServiceDataResource resource) { String _xblockexpression = null; { final Function1<ReferenceEmbed, String> _function = (ReferenceEmbed e) -> { return this.getReferenceTreatmentName(e); }; ArrayList<String> names = Lists.<String>newArrayList(ListExtensions.<ReferenceEmbed, String>map(ref.getEmbedHierarchy(), _function)); names.add(this.getReferenceTreatmentName(ref)); names.add(0, resource.getName()); _xblockexpression = IterableExtensions.join(names, "."); } return _xblockexpression; }
_builder.append(" "); _builder.append("\"name\": \""); String _name = aResource.getDataType().getName(); _builder.append(_name, " "); _builder.append("*\","); _builder.append(" "); _builder.append("\"id\": \""); String _name_1 = aResource.getName(); _builder.append(_name_1, " "); _builder.append(".baseType\",");
@Override public String generate(final ZenModel model, final ServiceDataResource serviceDataResource) { this.initZenElement2ClassName(model, serviceDataResource.eResource()); StringConcatenation _builder = new StringConcatenation(); _builder.append("package "); _builder_1.append(_typeName); _builder_1.append("(\""); URI _uRI = serviceDataResource.getURI(); _builder_1.append(_uRI); _builder_1.append("\")"); _builder_1.newLine(); EList<Method> _methods = serviceDataResource.getMethods(); for(final Method method : _methods) { _builder_1.append("\t");
return Boolean.valueOf((!_hasReferenceTreatment)); }; Iterable<Feature> _filter = IterableExtensions.<Feature>filter(resource.getDataType().getOwnedFeatures(), _function); for(final Feature aFeature : _filter) { boolean _isIncluded = resource.isIncluded(aFeature); if (_isIncluded) { CharSequence _generateIncludedPropertyRow = this.generateIncludedPropertyRow(this.getIncludedProperty(resource, aFeature));
@Check public void checkElementOrder(ServiceDataResource serviceDataResource) { String settingName = NLS.bind(Messages.RepreZenValidatorConfigurationBlock_random_order_issue_key_all, serviceDataResource.eClass().getName()); String setting = preferences.getString(settingName); if (!SeverityConverter.SEVERITY_IGNORE.equals(setting)) { List<INode> nodes = elementOrderSorter.getIncorrectOrderChildren(serviceDataResource); for (INode n : nodes) { if (n.getGrammarElement() instanceof Keyword) { settingName = NLS.bind(Messages.RepreZenValidatorConfigurationBlock_random_order_issue_key, serviceDataResource.eClass().getName(), ((Keyword) n.getGrammarElement()).getValue()); setting = preferences.getString(settingName); if (!SeverityConverter.SEVERITY_IGNORE.equals(setting)) { EObject semanticElement = findActualSemanticObject(n, serviceDataResource); if (serviceDataResource != semanticElement) { warning(NLS.bind(Messages.XtextDslJavaValidator_incorrect_order_warning, ((Keyword) n.getGrammarElement()).getValue()), semanticElement instanceof EStructuralFeature ? (EStructuralFeature) semanticElement : semanticElement.eContainingFeature(), INCORRECT_ELEMENT_ORDER, serviceDataResource.getName()); } } } } } }
private List<MatrixParameter> getMatrixParameters(final ServiceDataResource aResource) { List<MatrixParameter> _xifexpression = null; com.reprezen.rapidml.URI _uRI = aResource.getURI(); boolean _tripleNotEquals = (_uRI != null); if (_tripleNotEquals) { _xifexpression = IterableExtensions.<MatrixParameter>toList(Iterables.<MatrixParameter>filter(aResource.getURI().getUriParameters(), MatrixParameter.class)); } else { _xifexpression = Collections.<MatrixParameter>emptyList(); } return _xifexpression; }
private boolean hasReferenceTreatment(final ServiceDataResource resource, final Feature feature) { final Function1<ReferenceTreatment, ReferenceElement> _function = (ReferenceTreatment it) -> { return it.getReferenceElement(); }; final Function1<ReferenceElement, Boolean> _function_1 = (ReferenceElement f) -> { return Boolean.valueOf((f == feature)); }; return IterableExtensions.<ReferenceElement>exists(ListExtensions.<ReferenceTreatment, ReferenceElement>map(resource.getReferenceTreatments(), _function), _function_1); }
String _referenceTreatmentName = this.getReferenceTreatmentName(link); _builder.append(_referenceTreatmentName, " "); String _cardinalityLabel = com.reprezen.genflow.common.xtend.XDataTypeExtensions.getCardinalityLabel(link, aResource.getIncludedProperties()); _builder.append(_cardinalityLabel, " "); _builder.append("\","); _builder.append(" "); _builder.append("\"cardinality\": \""); String _cardinalityLabel_1 = com.reprezen.genflow.common.xtend.XDataTypeExtensions.getCardinalityLabel(link, aResource.getIncludedProperties()); _builder.append(_cardinalityLabel_1, " "); _builder.append("\",");
public static boolean isFeatureIncluded(EObject context, Feature feature) { if (context instanceof ServiceDataResource) { return ((ServiceDataResource) context).isIncluded(feature); } if (context instanceof TypedMessage) { return ((TypedMessage) context).isIncluded(feature); } return false; }
public void process(TypedMessage message) { // add resource level media types if message mediaTypes are absent if (message.getMediaTypes().isEmpty()) { Optional<ServiceDataResource> resource = getContainingResourceDefinition(message); if (resource.isPresent()) { message.getMediaTypes().addAll(resource.get().getMediaTypes()); } } }
_builder.newLine(); _builder.append("class "); String _name = this.resource.getName(); _builder.append(_name); _builder.append("Impl extends CustomImpl {"); _builder.newLineIfNotEmpty(); EList<Method> _methods = this.resource.getMethods(); boolean _hasElements = false; for(final Method method : _methods) { _builder.append(_httpMethod, "\t"); _builder.append(" "); String _expressify = this.expressify(this.resource.getURI()); _builder.append(_expressify, "\t"); _builder.newLineIfNotEmpty(); _builder.newLine(); _builder.append("module.exports = "); String _name_2 = this.resource.getName(); _builder.append(_name_2); _builder.append("Impl; ");
public static String getClassName(final ServiceDataResource inputElement) { StringConcatenation _builder = new StringConcatenation(); String _name = inputElement.getName(); _builder.append(_name); _builder.append("Resource"); return _builder.toString(); }
public Path createSwaggerPath(final ResourceDefinition res) { final Path path = new Path(); this.setVendorExtensions(((Extensible) res), path); com.reprezen.rapidml.URI _uRI = ((ServiceDataResource) res).getURI(); boolean _tripleNotEquals = (_uRI != null); if (_tripleNotEquals) { ((ServiceDataResource) res).getURI().getUriParameters().forEach(_function);