View Javadoc

1   /*
2    * Copyright 2007-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.exceptions.report.data;
17  
18  import java.util.List;
19  
20  /**
21   * Reports on exception codes.
22   */
23  public interface ExceptionCodesReport
24  {
25    // ********************************* Fields *********************************
26  
27    // --- constants ------------------------------------------------------------
28  
29    // ****************************** Initializer *******************************
30  
31    // ****************************** Inner Classes *****************************
32  
33    // ********************************* Methods ********************************
34  
35    // --- get&set --------------------------------------------------------------
36  
37    // --- business -------------------------------------------------------------
38  
39    // ... adding report items ..................................................
40  
41    /**
42     * Adds the given code information as an item to the report.
43     *
44     * @param code the report item on the code to add.
45     * @throws NullPointerException if {@code code} is <code>null</code>.
46     */
47    void add(ExceptionCodeReportItem code) throws NullPointerException;
48  
49    // ... dealing with problems ................................................
50  
51    /**
52     * Reports a problem encountered while analyzing for report items.
53     *
54     * @param problem a description to the problem encountered.
55     * @throws NullPointerException if {@code problem} is <code>null</code>.
56     */
57    void addProblem(ReportProblem problem) throws NullPointerException;
58  
59    /**
60     * Checks if there are reported problems.
61     *
62     * @return <code>true</code> if at least one report problem is reported,
63     *         <code>false</code> if there are none.
64     */
65    boolean hasProblems();
66  
67    /**
68     * Returns the list of problems encountered while parsing sources and fetching
69     * report information.
70     *
71     * @return the list of problems encountered while parsing sources and fetching
72     *         report information.
73     */
74    List<ReportProblem> getProblems();
75  
76    /**
77     * Checks if the report contains at least one item.
78     *
79     * @return <code>true</code> if the report contains at least one item,
80     *         <code>false</code> otherwise.
81     */
82    boolean isEmpty();
83  
84    // --- object basics --------------------------------------------------------
85  
86  }