Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2013, devbliss GmbH
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  * in compliance with the License. You may obtain a copy of the License at
  * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
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