Revision 3222
Added by berkley over 17 years ago
src/edu/ucsb/nceas/metacat/MetacatResultSet.java | ||
---|---|---|
51 | 51 |
* for printing to the servlet output stream. |
52 | 52 |
*/ |
53 | 53 |
public class MetacatResultSet extends DefaultHandler |
54 |
{ |
|
55 |
public static final String VALIDATIONFEATURE = "http://xml.org/sax/features/validation"; |
|
56 |
public static final String SCHEMAVALIDATIONFEATURE = "http://apache.org/xml/features/validation/schema"; |
|
57 |
public static final String NAMESPACEFEATURE = "http://xml.org/sax/features/namespaces"; |
|
58 |
public static final String NAMESPACEPREFIXESFEATURE = "http://xml.org/sax/features/namespace-prefixes"; |
|
59 |
public static final String RESOLVEDTDFEATURE = "http://apache.org/sax/features/load-dtd-grammar"; |
|
60 |
public static final String LOADDTDFEATURE = "http://apache.org/sax/features/load-external-dtd"; |
|
61 |
public static final String DOCTYPEDECLFEATURE = "http://apache.org/sax/features/disallow-doctype-decl"; |
|
62 |
public static final String DECLARATIONHANDLERPROPERTY = "http://xml.org/sax/properties/declaration-handler"; |
|
63 |
public static final String LEXICALPROPERTY = "http://xml.org/sax/properties/lexical-handler"; |
|
64 |
|
|
54 |
{ |
|
65 | 55 |
private Logger log = Logger.getLogger(MetacatResultSet.class); |
66 | 56 |
private Vector results = new Vector(); |
67 | 57 |
private Result currentResult = null; |
... | ... | |
69 | 59 |
Attributes atts = null; |
70 | 60 |
|
71 | 61 |
/** |
72 |
* default constructor |
|
73 |
*/ |
|
74 |
public MetacatResultSet() |
|
75 |
{ |
|
76 |
|
|
77 |
} |
|
78 |
|
|
79 |
/** |
|
80 | 62 |
* constructor that can process a dom. WARNING: this is very slow. |
81 | 63 |
*/ |
82 | 64 |
public MetacatResultSet(Document d) |
... | ... | |
213 | 195 |
*/ |
214 | 196 |
public void fatalError(SAXParseException exception) throws SAXException |
215 | 197 |
{ |
216 |
log.fatal("FATALERROR: " + exception.getMessage()); |
|
217 |
throw (new SAXException("Fatal error processing/caching resultset.", exception)); |
|
198 |
log.fatal("FATALERROR while parsing/caching resultset: " + |
|
199 |
exception.getMessage()); |
|
200 |
throw (new SAXException("Fatal error processing/caching resultset.", |
|
201 |
exception)); |
|
218 | 202 |
} |
219 | 203 |
|
220 | 204 |
/** |
... | ... | |
222 | 206 |
*/ |
223 | 207 |
public void error(SAXParseException exception) throws SAXException |
224 | 208 |
{ |
225 |
log.error("ERROR: " + exception.getMessage()); |
|
226 |
throw (new SAXException("Error in processing/caching resultset.", exception)); |
|
209 |
log.error("ERROR while parsing/caching resultset: " + |
|
210 |
exception.getMessage()); |
|
211 |
throw (new SAXException("Error in processing/caching resultset.", |
|
212 |
exception)); |
|
227 | 213 |
} |
228 | 214 |
|
229 | 215 |
/** |
... | ... | |
231 | 217 |
*/ |
232 | 218 |
public void warning(SAXParseException exception) throws SAXException |
233 | 219 |
{ |
234 |
log.warn("WARNING while parsing/caching resultset: " + exception.getMessage()); |
|
220 |
log.warn("WARNING while parsing/caching resultset: " + |
|
221 |
exception.getMessage()); |
|
235 | 222 |
throw (new SAXException("Warning.", exception)); |
236 | 223 |
} |
237 | 224 |
|
Also available in: Unified diff
reformatted a bit and removed unneeded code