Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.devbliss.doctest.items;

A DocItem is a part of a report which could appear several times in it. In other words, a report is an sorted amount of DocItem.


We need this common interface to have the possibility to treat all the DocItem the same way. It allows us to create a 'logic' report as a list of DocItem. This does not depend on the output format and can be easily generated / tested / improved.


The following example shows a possible way to use the DocItem;
List<DocItem> listItems = new ArrayList<DocItem>();
listItems.add(new SectionDocItem("test the delete Request"));
listItems.add(new RequestDocItem(DELETE, "", null)); listItems.add(new ResponseDocItem(401, "you can not delete google")); htmlRenderer.render(listItems);

This example will create am html report containing:

  • a section which title is "test the delete Request"
  • a request section containing the informations about the request
  • a response section containing the informations about the response

If you need a new DocItem, just create a new implementation of DocItem.

public interface DocItem {
    public String getItemName();
New to GrepCode? Check out our FAQ X