1 package org.tigris.scarab.util.xmlissues; 2 3 48 49 import java.util.AbstractCollection ; 50 import java.util.ArrayList ; 51 import java.util.Collection ; 52 import java.util.Iterator ; 53 54 import org.apache.commons.collections.IteratorUtils; 55 56 62 class ImportErrors extends AbstractCollection 63 { 64 67 private Collection errors; 68 69 72 private Object parseContext = null; 73 74 public ImportErrors() 75 { 76 } 77 78 public Iterator iterator() 79 { 80 return (errors == null ? 81 IteratorUtils.EMPTY_ITERATOR : errors.iterator()); 82 } 83 84 public int size() 85 { 86 return (errors == null ? 0 : errors.size()); 87 } 88 89 97 public boolean add(Object error) 98 { 99 if (errors == null) 100 { 101 errors = new ArrayList (); 102 } 103 if (parseContext != null) 104 { 105 error = '[' + parseContext.toString() + "] " + error; 108 } 109 return errors.add(error); 110 } 111 112 121 public void setParseContext(Object parseContext) 122 { 123 this.parseContext = parseContext; 124 } 125 } 126 | Popular Tags |