01: /*
02: * Copyright (C) 2004 Joe Walnes.
03: * Copyright (C) 2006, 2007, 2008 XStream Committers.
04: * All rights reserved.
05: *
06: * The software in this package is published under the terms of the BSD
07: * style license a copy of which has been included with this distribution in
08: * the LICENSE.txt file.
09: *
10: * Created on 08. May 2004 by Joe Walnes
11: */
12: package com.thoughtworks.xstream.converters;
13:
14: import java.util.Iterator;
15:
16: /**
17: * To aid debugging, some components are passed an ErrorWriter
18: * when things go wrong, allowing them to add information
19: * to the error message that may be helpful to diagnose problems.
20: *
21: * @author Joe Walnes
22: * @author Jörg Schaible
23: */
24: public interface ErrorWriter {
25:
26: /**
27: * Add some information to the error message.
28: *
29: * @param name something to identify the type of information (e.g. 'XPath').
30: * @param information detail of the message (e.g. '/blah/moo[3]'
31: */
32: void add(String name, String information);
33:
34: /**
35: * Retrieve information of the error message.
36: *
37: * @param errorKey the key of the message
38: * @return the value
39: * @since 1.3
40: */
41: String get(String errorKey);
42:
43: /**
44: * Retrieve an iterator over all keys of the error message.
45: *
46: * @return an Iterator
47: * @since 1.3
48: */
49: Iterator keys();
50: }
|