01: /*
02: * BreakpointSpecification.java
03: *
04: * Copyright (C) 2002-2003 Peter Graves
05: * $Id: BreakpointSpecification.java,v 1.2 2003/06/03 16:51:07 piso Exp $
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License
09: * as published by the Free Software Foundation; either version 2
10: * of the License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20: */
21:
22: package org.armedbear.j.jdb;
23:
24: import org.armedbear.j.FastStringBuffer;
25: import org.armedbear.j.Log;
26: import org.xml.sax.Attributes;
27:
28: public final class BreakpointSpecification {
29: private final String className;
30: private final String methodName;
31: private final String fileName;
32: private final int lineNumber;
33:
34: public BreakpointSpecification(Attributes attributes) {
35: className = attributes.getValue("className");
36: methodName = attributes.getValue("methodName");
37: fileName = attributes.getValue("fileName");
38: int n = 0;
39: String s = attributes.getValue("lineNumber");
40: if (s != null) {
41: try {
42: n = Integer.parseInt(s);
43: } catch (NumberFormatException e) {
44: Log.error(e);
45: }
46: }
47: lineNumber = n;
48: }
49:
50: public String getClassName() {
51: return className;
52: }
53:
54: public String getMethodName() {
55: return methodName;
56: }
57:
58: public String getFileName() {
59: return fileName;
60: }
61:
62: public int getLineNumber() {
63: return lineNumber;
64: }
65:
66: // Only used to generate meaningful trace output.
67: public String toString() {
68: final String separator = System.getProperty("line.separator");
69: FastStringBuffer sb = new FastStringBuffer(
70: "BreakpointSpecification: ");
71: sb.append(separator);
72: sb.append(" className = " + className);
73: sb.append(separator);
74: sb.append(" methodName = " + methodName);
75: sb.append(separator);
76: sb.append(" fileName = " + fileName);
77: sb.append(separator);
78: sb.append(" lineNumber = " + lineNumber);
79: return sb.toString();
80: }
81: }
|