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.breakpoints;
21:
22: import javax.xml.namespace.QName;
23: import org.netbeans.modules.bpel.debugger.*;
24: import org.netbeans.modules.bpel.debugger.api.EditorContextBridge;
25: import org.netbeans.modules.bpel.debugger.api.breakpoints.LineBreakpoint;
26:
27: /**
28: *
29: * @author Joshua Sanduski
30: * @author Alexander Zgursky
31: */
32: public abstract class SBYNBreakpoint {
33:
34: private LineBreakpoint myBreakpoint;
35: private BpelDebuggerImpl myDebugger;
36: private String myUrl;
37: private String myXpath;
38: private QName myProcessQName;
39:
40: protected SBYNBreakpoint(LineBreakpoint bpelBreakpoint,
41: BpelDebuggerImpl debugger) {
42: myBreakpoint = bpelBreakpoint;
43: myDebugger = debugger;
44: myUrl = bpelBreakpoint.getURL();
45: myXpath = bpelBreakpoint.getXpath();
46:
47: //TODO:ugly hack
48: //in this implementation myProcessQName can be null.
49: //It's better not to create SBYNBreakpoint at all in such a case.
50: //So, for now, just ensure getProcessQName doesn't return null
51: myProcessQName = EditorContextBridge.getProcessQName(myUrl);
52: if (myProcessQName == null) {
53: myProcessQName = new QName("");
54: }
55: //end of ugly hack
56:
57: }
58:
59: protected BpelDebuggerImpl getDebugger() {
60: return myDebugger;
61: }
62:
63: public String getURL() {
64: return myUrl;
65: }
66:
67: public QName getProcessQName() {
68: return myProcessQName;
69: }
70:
71: public String getXpath() {
72: return myXpath;
73: }
74:
75: public boolean isEnabled() {
76: return myBreakpoint.isEnabled();
77: }
78:
79: public boolean isAt(QName processQName, String xpath) {
80: if (getProcessQName().equals(processQName)
81: && getXpath().equals(xpath)) {
82: return true;
83: } else {
84: return false;
85: }
86: }
87: }
|