View Javadoc

1   /*
2    * Copyright 2010-2013 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package de.smartics.testdoc.report.index;
17  
18  import java.io.Serializable;
19  
20  import de.smartics.testdoc.core.doc.UnitTestDoc;
21  
22  /**
23   * The export index creates the configured indexes.
24   * <p>
25   * Test documentation entries can be structured in more than one way.
26   * </p>
27   *
28   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
29   * @version $Revision:591 $
30   */
31  public interface ExportIndex extends Serializable
32  {
33    // ********************************* Fields *********************************
34  
35    // --- constants ------------------------------------------------------------
36  
37    // ****************************** Initializer *******************************
38  
39    // ****************************** Inner Classes *****************************
40  
41    // ********************************* Methods ********************************
42  
43    // --- get&set --------------------------------------------------------------
44  
45    /**
46     * Returns the name of the section generated by this index.
47     *
48     * @return the name of the generated section.
49     */
50    String getSectionName();
51  
52    // --- business -------------------------------------------------------------
53  
54    /**
55     * Adds the given test documentation instance to the index.
56     *
57     * @param testDoc the instance to be added.
58     */
59    void addToIndex(UnitTestDoc testDoc);
60  
61    /**
62     * Returns a reference to the root section of the index.
63     *
64     * @return a reference to the root section of the index. Never returns
65     *         <code>null</code>.
66     */
67    Section<UnitTestDoc> getSection();
68  
69    /**
70     * Checks if this or any sub sections contains at least one item.
71     *
72     * @return <code>true</code> if at least one item is in this index,
73     *         <code>false</code> otherwise.
74     */
75    boolean isEmpty();
76  
77    // --- object basics --------------------------------------------------------
78  
79  }