1 17 18 19 20 package org.apache.fop.fotreetest; 21 22 import java.util.Collections ; 23 import java.util.List ; 24 25 28 public class ResultCollector { 29 30 private static ResultCollector instance = null; 31 32 private List results = new java.util.ArrayList (); 33 34 35 public static ResultCollector getInstance() { 36 if (instance == null) { 37 instance = new ResultCollector(); 38 } 39 return instance; 40 } 41 42 43 public ResultCollector() { 44 } 46 47 51 public void notifyException(Exception e) { 52 System.out.println(e.getMessage()); 53 results.add(e); 54 } 55 56 57 public void reset() { 58 results.clear(); 59 } 60 61 62 public List getResults() { 63 return Collections.unmodifiableList(results); 64 } 65 } 66 | Popular Tags |