All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.reprezen.genflow.openapi3.doc.ModelDoc Maven / Gradle / Ivy

/**
 * Copyright © 2013, 2016 Modelsolv, Inc.
 * All Rights Reserved.
 * 
 * NOTICE: All information contained herein is, and remains the property
 * of ModelSolv, Inc. See the file license.html in the root directory of
 * this project for further information.
 */
package com.reprezen.genflow.openapi3.doc;

import com.reprezen.genflow.openapi3.doc.DocHelper;
import com.reprezen.genflow.openapi3.doc.HelperHelper;
import com.reprezen.genflow.openapi3.doc.HtmlHelper;
import com.reprezen.genflow.openapi3.doc.SchemaHelper;
import com.reprezen.kaizen.oasparser.model3.OpenApi3;
import com.reprezen.kaizen.oasparser.model3.Schema;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;

@SuppressWarnings("all")
public class ModelDoc {
  private final OpenApi3 model = HelperHelper.getModel();
  
  private final String name;
  
  private final Schema definition;
  
  @Extension
  private SchemaHelper _schemaHelper = HelperHelper.getSchemaHelper();
  
  @Extension
  private DocHelper _docHelper = HelperHelper.getDocHelper();
  
  @Extension
  private HtmlHelper _htmlHelper = HelperHelper.getHtmlHelper();
  
  public ModelDoc(final String name) {
    this.name = name;
    this.definition = this.model.getSchemas().get(name);
  }
  
  public CharSequence getHtml() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("");
    _builder.newLineIfNotEmpty();
    _builder.append("
"); _builder.newLine(); _builder.append(" "); _builder.append("
"); _builder.newLine(); _builder.append(" "); _builder.append("

"); _builder.append(this.name, " "); _builder.append("

"); _builder.newLineIfNotEmpty(); _builder.append(" "); _builder.append("
"); _builder.newLine(); _builder.append(" "); _builder.append("
"); _builder.newLine(); _builder.append(" "); String _docHtml = this._docHelper.getDocHtml(this.definition.getDescription()); _builder.append(_docHtml, " "); _builder.newLineIfNotEmpty(); _builder.append(" "); CharSequence _renderSchema = this._schemaHelper.renderSchema(this.definition); _builder.append(_renderSchema, " "); _builder.newLineIfNotEmpty(); _builder.append(" "); _builder.append("
"); _builder.newLine(); _builder.append("
"); _builder.newLine(); return _builder; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy