| 1 | /* This file is part of the project "Hilbert II" - http://www.qedeq.org |
| 2 | * |
| 3 | * Copyright 2000-2014, Michael Meyling <mime@qedeq.org>. |
| 4 | * |
| 5 | * "Hilbert II" is free software; you can redistribute |
| 6 | * it and/or modify it under the terms of the GNU General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | package org.qedeq.kernel.bo.service.basis; |
| 17 | |
| 18 | import org.qedeq.kernel.se.common.SourceFileExceptionList; |
| 19 | |
| 20 | /** |
| 21 | * Holds the results from a plugin execution. |
| 22 | * |
| 23 | * @author Michael Meyling |
| 24 | */ |
| 25 | public class ModuleServicePluginResults { |
| 26 | |
| 27 | /** Errors that occurred. */ |
| 28 | private SourceFileExceptionList errors; |
| 29 | |
| 30 | /** Warnings that occurred. */ |
| 31 | private SourceFileExceptionList warnings; |
| 32 | |
| 33 | /** |
| 34 | * Creates a new result container. |
| 35 | */ |
| 36 | public ModuleServicePluginResults() { |
| 37 | errors = new SourceFileExceptionList(); |
| 38 | warnings = new SourceFileExceptionList(); |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Clear all warnings and errors. |
| 43 | */ |
| 44 | public void clear() { |
| 45 | errors.clear(); |
| 46 | warnings.clear(); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Get list of all errors. |
| 51 | * |
| 52 | * @return Error list. Is never <code>null</code>. |
| 53 | */ |
| 54 | public SourceFileExceptionList getErrors() { |
| 55 | return errors; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Add errors. |
| 60 | * |
| 61 | * @param errors Add these errors. |
| 62 | */ |
| 63 | public void addErrors(final SourceFileExceptionList errors) { |
| 64 | this.errors.add(errors); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Get list of all warnings. |
| 69 | * |
| 70 | * @return Warnings list. Is never <code>null</code>. |
| 71 | */ |
| 72 | public SourceFileExceptionList getWarnings() { |
| 73 | return warnings; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Add warnings. |
| 78 | * |
| 79 | * @param warnings Add these warnings. |
| 80 | */ |
| 81 | public void addWarnings(final SourceFileExceptionList warnings) { |
| 82 | this.warnings.add(warnings); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Are there any errors? |
| 87 | * |
| 88 | * @return Errors exist. |
| 89 | */ |
| 90 | public boolean hasErrors() { |
| 91 | return errors.size() > 0; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Are there any warnings. |
| 96 | * |
| 97 | * @return Warnings exist. |
| 98 | */ |
| 99 | public boolean hasWarnings() { |
| 100 | return warnings.size() > 0; |
| 101 | } |
| 102 | |
| 103 | } |