1 10 package com.hp.hpl.jena.reasoner; 11 12 import java.util.*; 13 14 21 public class StandardValidityReport implements ValidityReport { 22 23 24 protected List reports = new ArrayList(); 25 26 27 protected boolean isError; 28 29 35 public void add(boolean error, String type, String description) { 36 add(error, type, description, null); 37 } 38 39 46 public void add(boolean error, String type, String description, Object extension) { 47 reports.add(new Report(error, type, description, extension)); 48 if (error) { 49 isError = true; 50 } 51 } 52 53 57 public void add(ValidityReport.Report report) { 58 if (report == null) return; 59 reports.add(report); 60 if (report.isError) { 61 isError = true; 62 } 63 } 64 65 66 72 public boolean isValid() { 73 return !isError; 74 } 75 76 80 public boolean isClean() { 81 return reports.isEmpty(); 82 } 83 84 88 public int size() { 89 return reports.size(); 90 } 91 92 93 96 public Iterator getReports() { 97 return reports.iterator(); 98 } 99 100 101 } 102 103 129 130 | Popular Tags |