public void appendHtml()

in lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java [499:611]


  public void appendHtml(final Writer writer) throws IOException {
    // factory for JSON generators (the object mapper is necessary to write expression trees)
    final JsonFactory jsonFactory = new ObjectMapper().getFactory();
    if (uriInfo.getKind() == UriInfoKind.resource) {
      writer.append("<h2>Resource Path</h2>\n")
          .append("<ul>\n<li class=\"json\">");
      try (JsonGenerator json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter()) {
        appendURIResourceParts(json, uriInfo.getUriResourceParts());
        json.close();
        writer.append("\n</li>\n</ul>\n");
      }
    } else if (uriInfo.getKind() == UriInfoKind.crossjoin) {
      writer.append("<h2>Crossjoin EntitySet Names</h2>\n")
          .append("<ul>\n");
      for (final String name : uriInfo.asUriInfoCrossjoin().getEntitySetNames()) {
        writer.append("<li>").append(name).append("</li>\n");
      }
      writer.append("</ul>\n");
    } else {
      writer.append("<h2>Kind</h2>\n<p>").append(uriInfo.getKind().name()).append("</p>\n");
      if (uriInfo.getKind() == UriInfoKind.entityId && uriInfo.asUriInfoEntityId().getEntityTypeCast() != null) {
        writer.append("<h2>Type Cast</h2>\n<p>")
            .append(uriInfo.asUriInfoEntityId().getEntityTypeCast().getFullQualifiedName()
                .getFullQualifiedNameAsString())
            .append("</p>\n");
      }
    }

    if (uriInfo.getSearchOption() != null) {
      writer.append("<h2>Search Option</h2>\n")
          .append("<ul>\n<li class=\"json\">");
      try (JsonGenerator json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter()) {
        appendSearchJson(json, uriInfo.getSearchOption().getSearchExpression());
        json.close();
        writer.append("\n</li>\n</ul>\n");
      }
    }

    if (uriInfo.getFilterOption() != null) {
      writer.append("<h2>Filter Option</h2>\n")
          .append("<ul>\n<li class=\"json\">");
      try (JsonGenerator json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter()) {
        appendExpressionJson(json, uriInfo.getFilterOption().getExpression());
        json.close();
        writer.append("\n</li>\n</ul>\n");
      }
    }

    if (uriInfo.getOrderByOption() != null) {
      writer.append("<h2>OrderBy Option</h2>\n")
          .append("<ul>\n<li class=\"json\">");
      try (JsonGenerator json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter()) {
        appendOrderByItemsJson(json, uriInfo.getOrderByOption().getOrders());
        json.close();
        writer.append("\n</li>\n</ul>\n");
      }
    }

    if (uriInfo.getExpandOption() != null) {
      writer.append("<h2>Expand Option</h2>\n")
          .append("<ul>\n<li class=\"json\">");
      try (JsonGenerator json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter()) {
        appendExpandedPropertiesJson(json, uriInfo.getExpandOption().getExpandItems());
        json.close();
        writer.append("\n</li>\n</ul>\n");
      }
    }

    if (uriInfo.getSelectOption() != null) {
      writer.append("<h2>Selected Properties</h2>\n")
          .append("<ul>\n");
      for (final SelectItem selectItem : uriInfo.getSelectOption().getSelectItems()) {
        writer.append("<li>").append(getSelectString(selectItem)).append("</li>\n");
      }
      writer.append("</ul>\n");
    }

    if (uriInfo.getApplyOption() != null) {
      writer.append("<h2>Apply Option</h2>\n")
          .append("<ul>\n<li class=\"json\">");
      try (JsonGenerator json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter()) {
        appendApplyItemsJson(json, uriInfo.getApplyOption().getApplyItems());
        json.close();
        writer.append("\n</li>\n</ul>\n");
      }
    }

    if (uriInfo.getCountOption() != null
        || uriInfo.getSkipOption() != null
        || uriInfo.getSkipTokenOption() != null
        || uriInfo.getTopOption() != null
        || uriInfo.getFormatOption() != null
        || uriInfo.getIdOption() != null) {
      writer.append("<h2>Unstructured System Query Options</h2>\n");
      DebugResponseHelperImpl.appendHtmlTable(writer, getQueryOptionsMap(Arrays.asList(
          uriInfo.getCountOption(),
          uriInfo.getSkipOption(),
          uriInfo.getSkipTokenOption(),
          uriInfo.getTopOption(),
          uriInfo.getFormatOption(),
          uriInfo.getIdOption())));
    }

    if (!uriInfo.getAliases().isEmpty()) {
      writer.append("<h2>Aliases</h2>\n");
      DebugResponseHelperImpl.appendHtmlTable(writer, getQueryOptionsMap(uriInfo.getAliases()));
    }

    if (!uriInfo.getCustomQueryOptions().isEmpty()) {
      writer.append("<h2>Custom Query Options</h2>\n");
      DebugResponseHelperImpl.appendHtmlTable(writer, getQueryOptionsMap(uriInfo.getCustomQueryOptions()));
    }
  }