changing license to BSD, assigning Yahoo copyrights where appropriate
[lwes-java.git] / src / main / java / org / lwes / ValidationExceptions.java
blob838c3e7035455844cf9398e9a200a87d57a5155c
1 /*======================================================================*
2 * Copyright (c) 2010, Frank Maritato All rights reserved. *
3 * *
4 * Licensed under the New BSD License (the "License"); you may not use *
5 * this file except in compliance with the License. Unless required *
6 * by applicable law or agreed to in writing, software distributed *
7 * under the License is distributed on an "AS IS" BASIS, WITHOUT *
8 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
9 * See the License for the specific language governing permissions and *
10 * limitations under the License. See accompanying LICENSE file. *
11 *======================================================================*/
13 package org.lwes;
14 /**
15 * @author fmaritato
18 import java.util.ArrayList;
19 import java.util.LinkedList;
20 import java.util.List;
22 public class ValidationExceptions extends EventSystemException {
24 List<EventSystemException> allExceptions = new LinkedList<EventSystemException>();
26 public ValidationExceptions(Throwable e) {
27 super(e);
30 public ValidationExceptions(String s) {
31 super(s);
34 public ValidationExceptions(String s, Throwable e) {
35 super(s, e);
38 public void addException(EventSystemException e) {
39 allExceptions.add(e);
41 public List<EventSystemException> getAllExceptions() {
42 return new ArrayList(allExceptions);
44 public boolean hasExceptions() {
45 return allExceptions.size() > 0;
48 public String toString() {
49 StringBuilder buf = new StringBuilder();
50 buf.append("ValidationExceptions {\n");
51 for (Exception e : allExceptions) {
52 buf.append(e.toString()).append("\n");
54 buf.append("\n}");
55 return buf.toString();