01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: package org.netbeans.modules.bpel.debugger;
21:
22: import javax.xml.namespace.QName;
23: import org.netbeans.modules.bpel.debugger.api.EditorContextBridge;
24: import org.netbeans.modules.bpel.debugger.api.Position;
25: import org.netbeans.modules.bpel.debugger.bdiclient.impl.BDIDebugFrame;
26:
27: /**
28: * Represents a break position, which is a line in a BPEL file
29: * that corresponds to a process instance (debug frame).
30: * When a breakpoint is reached, a break position is created that
31: * represents where that breakpoint is, and to what back-end
32: * process instance the breakpoint corresponds to.
33: *
34: * @author Sun Microsystems
35: */
36: public class BreakPosition implements Position {
37:
38: private final BDIDebugFrame myFrame;
39: private final String myXpath;
40: private final int myLineNumber;
41:
42: public BreakPosition(final BDIDebugFrame frame, final String xpath,
43: final int lineNumber) {
44: myFrame = frame;
45: myXpath = EditorContextBridge.normalizeXpath(xpath);
46: myLineNumber = lineNumber;
47: }
48:
49: public QName getProcessQName() {
50: return myFrame.getProcessInstance().getProcessQName();
51: }
52:
53: public String getXpath() {
54: return myXpath;
55: }
56:
57: public int getLineNumber() {
58: return myLineNumber;
59: }
60:
61: public String getBranchId() {
62: return myFrame.getId();
63: }
64:
65: public BDIDebugFrame getFrame() {
66: return myFrame;
67: }
68:
69: @Override
70: public String toString() {
71: return myFrame.getId() + " at " + myXpath;
72: }
73: }
|