Revision 11681

View differences:

trunk/libraries/libGPE/src-test/org/gvsig/gpe/GPEErrorHandlerTest.java
1 1
package org.gvsig.gpe;
2

  
3
import java.util.ArrayList;
4

  
5
import org.gvsig.exceptions.BaseException;
6

  
2 7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3 8
 *
4 9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
......
43 48
 *
44 49
 * $Id$
45 50
 * $Log$
46
 * Revision 1.4  2007-04-19 07:23:20  jorpiell
51
 * Revision 1.5  2007-05-16 09:27:55  jorpiell
52
 * Added two arrays to manage exceptions
53
 *
54
 * Revision 1.4  2007/04/19 07:23:20  jorpiell
47 55
 * Add the add methods to teh contenhandler and change the register mode
48 56
 *
49 57
 * Revision 1.3  2007/04/17 07:53:55  jorpiell
......
61 69
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
62 70
 */
63 71
public class GPEErrorHandlerTest extends GPEErrorHandler{
64
	/*
65
	 * (non-Javadoc)
66
	 * @see org.gvsig.gpe.IGPEErrorHandler#addError(java.lang.Throwable)
67
	 */
68
	public void addError(Throwable e) {
69
		e.printStackTrace();
70
		
71
	}
72 72

  
73
	/*
74
	 * (non-Javadoc)
75
	 * @see org.gvsig.gpe.IGPEErrorHandler#addWarning(java.lang.Throwable)
76
	 */
77
	public void addWarning(Throwable e) {
78
		// TODO Auto-generated method stub
79
		
80
	}
81

  
82 73
}
trunk/libraries/libGPE/src/org/gvsig/gpe/GPEErrorHandler.java
1 1
package org.gvsig.gpe;
2

  
3
import java.util.ArrayList;
4

  
2 5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3 6
 *
4 7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
......
43 46
 *
44 47
 * $Id$
45 48
 * $Log$
46
 * Revision 1.4  2007-04-19 07:23:20  jorpiell
49
 * Revision 1.5  2007-05-16 09:27:24  jorpiell
50
 * Added two arrays to manage exceptions
51
 *
52
 * Revision 1.4  2007/04/19 07:23:20  jorpiell
47 53
 * Add the add methods to teh contenhandler and change the register mode
48 54
 *
49 55
 * Revision 1.3  2007/04/17 07:53:55  jorpiell
......
61 67
 * @author Carlos S?nchez Peri??n (sanchez_carper@gva.es)
62 68
 */
63 69
public abstract class GPEErrorHandler implements IGPEErrorHandler {
64

  
70
	private ArrayList errors = null;
71
	private ArrayList warnings = null;
72
		
73
	public GPEErrorHandler() {
74
		super();
75
		errors = new ArrayList();
76
		warnings = new ArrayList();
77
	}
78
	
65 79
	/*
66 80
	 * (non-Javadoc)
67 81
	 * @see org.gvsig.gpe.IGPEErrorHandler#addError(java.lang.Throwable)
68 82
	 */
69 83
	public void addError(Throwable e) {
70
		// TODO Auto-generated method stub
71
		
84
		errors.add(e);			
72 85
	}
73 86

  
74 87
	/*
......
76 89
	 * @see org.gvsig.gpe.IGPEErrorHandler#addWarning(java.lang.Throwable)
77 90
	 */
78 91
	public void addWarning(Throwable e) {
79
		// TODO Auto-generated method stub
80
		
92
		warnings.add(e);		
81 93
	}
82 94

  
95
	/**
96
	 * @return the errors size
97
	 */
98
	public int getErrorsSize() {
99
		return errors.size();
100
	}
101

  
102
	/**
103
	 * @return the warnings size
104
	 */
105
	public int getWarningsSize() {
106
		return warnings.size();
107
	}
83 108
	
109
	/**
110
	 * Get a error
111
	 * @param i
112
	 * Error position
113
	 * @return
114
	 * The exception
115
	 */
116
	public Throwable getErrorAt(int i) {
117
		return (Throwable)errors.get(i);
118
	}
84 119

  
120
	/**
121
	 * Get a warning
122
	 * @param i
123
	 * Warning position
124
	 * @return
125
	 * The warning exception
126
	 */
127
	public Throwable getWarningAt(int i) {
128
		return (Throwable) warnings.get(i);
129
	}	
130

  
85 131
}

Also available in: Unified diff