2 * Copyright (C) 2018 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.exception
;
12 * This Exception is for throwing an exception if a filter prevents a method
13 * from returning any value except an empty one.
14 * This is because the filter condition itself can never be <code>true</code>
15 * (e.g. because a given subtree ID does not exist in the database at all)
16 * or because non of the data matches the filter.
18 * In the first case it is recommended to set the invalidFilter parameter to <code>true</code>
19 * to indicate that the filter itself might be not correct.
24 public class FilterException
extends Exception
{
26 private static final long serialVersionUID
= 7491596488082796101L;
28 private boolean invalidFilter
;
30 public FilterException(boolean invalidFilter
) {
32 this.setInvalidFilter(invalidFilter
);
35 public FilterException(String message
, boolean invalidFilter
) {
37 this.setInvalidFilter(invalidFilter
);
43 public FilterException(Throwable cause
, boolean invalidFilter
) {
45 this.setInvalidFilter(invalidFilter
);
52 public FilterException(String message
, Throwable cause
, boolean invalidFilter
) {
53 super(message
, cause
);
54 this.setInvalidFilter(invalidFilter
);
57 public boolean isInvalidFilter() {
61 public void setInvalidFilter(boolean invalidFilter
) {
62 this.invalidFilter
= invalidFilter
;