JavaBreakpoint Class

com.bea.ide.lang.java.driver
JavaBreakpoint Class

public class JavaBreakpoint

    extends SourceBreakpoint

The JavaBreakPoint class will implement a breakpoint more specific to a Java file. It will do a couple of peices of special processing to associate a line+file to class name, and associating a method signature to line. It handles checking to see if a breakpoint is inside a nested class and names the breakpoint accordingly.


Hierarchy
Object
  DefaultBreakpoint
    SourceBreakpoint
      JavaBreakpoint
All Implemented Interfaces

IDebugBreakPoint, ISourceBreakPoint, Serializable

Nested Class Summary

 
Nested classes from  com.bea.ide.sourceeditor.driver.SourceBreakpoint
SourceBreakpoint.DefaultLine
 

Field Summary

protected transient String
_displayName
The name that is displayed to the user to represent this breakpoint.
protected transient ISourceDocument
_file
The sourec document this breakpoints lives in.
   
Fields from  com.bea.ide.sourceeditor.driver.SourceBreakpoint
_doc, _file, _line, _lineNum, _model
 
Fields from  com.bea.ide.debug.DefaultBreakpoint
_fDisabled, _id, _message, _properties, _propertyChangeSupport
 
Fields from interface com.bea.ide.debug.IDebugBreakPoint
BP_PROP_CONDITION, INVALID_ID, PROP_ERROR_MESSAGE
 
Fields from interface com.bea.ide.debug.ISourceBreakPoint
PROP_LINE_NUMBER
 

Constructor Summary

JavaBreakpoint(IDocument file, int line)

Creates a new breakpoint on the specified line in the specified document.
 

Method Summary

public IDebugInstructionPoint
breakpointHit()
This is called when the breakpoint gets hit.
public void
clearBreakpoint(IDebugBreakPoint.IBreakpointContext dbgCmds)
This is called to have the Breakpoint clear itself with the proxy.
public void
disable(boolean fDisable, IDebugBreakPoint.IBreakpointContext bpCtx)
This will either disable or re-enable a breakpoint, depending on the value of fdisable.
public void
documentLoaded()
In init, this breakpoint is about to be associated with an actual file.
public void
documentUnloaded()
In the case that a file is going away, we need to make sure to persist the current offset info.
public void
reset(Element elt)
protected String
resolve()
public synchronized boolean
supportsProperty(Integer prop)
Java breakpoints currently support conditions (IDebugBreakPoint.BP_PROP_CONDITION) and expression evaluation (Integer 500, 501, and 502).
public void
syncBreakpoint(IDebugBreakPoint.IBreakpointContext dbgCmds)
This is called to have the Breakpoint synchronize itself with the proxy.
public String
toString()
Java breakpoints display as "CLASSNAME @ LINENUMBER"
public void
updateLine()
Re-syncs the line information with the underlying document
 
Methods from  com.bea.ide.sourceeditor.driver.SourceBreakpoint
getCachedDocument, getExtension, getFile, getLine, getURI,
 
Methods from  com.bea.ide.debug.DefaultBreakpoint
getErrorMessage, getId, getProperties, getProperty, isDisabled, isValid, setErrorMessage, setId, setProperties, setProperty, toString
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface com.bea.ide.debug.IDebugBreakPoint
breakpointHit, clearBreakpoint, disable, getErrorMessage, getId, getProperties, getProperty, isDisabled, isValid, setErrorMessage, setId, setProperties, setProperty, supportsProperty, syncBreakpoint
 
Methods from interface com.bea.ide.debug.ISourceBreakPoint
documentLoaded, documentUnloaded, getCachedDocument, getLine, getURI, updateLine
 

Field Detail

_displayName

protected transient String _displayName
The name that is displayed to the user to represent this breakpoint.


_file

protected transient ISourceDocument _file
The sourec document this breakpoints lives in. This will be null if the breakpoint is unloaded.

 

Constructor Detail

JavaBreakpoint

public JavaBreakpoint(IDocument file, 
                      int line)
Creates a new breakpoint on the specified line in the specified document.
 

Method Detail

breakpointHit() Method

public IDebugInstructionPoint breakpointHit()
Description copied from IDebugBreakPoint.breakpointHit()
This is called when the breakpoint gets hit. This should take care of any processing that is needed when a breakpoint is hit. Normally, this will entail bringing the file to the forground, jumping to the current line, and setting an instruction point at the correct place.

Overrides
SourceBreakpoint.breakpointHit()

Returns

the new instruction point, or null if this breakpoint doesn't know how to display itself, like an exception breakpoint

clearBreakpoint(IDebugBreakPoint.IBreakpointContext) Method

public void clearBreakpoint(IDebugBreakPoint.IBreakpointContext dbgCmds)
throws DebugTransportException
Description copied from IDebugBreakPoint.clearBreakpoint(IDebugBreakPoint.IBreakpointContext)
This is called to have the Breakpoint clear itself with the proxy. This function will be called when a breakpoint in being removed.

Overrides
DefaultBreakpoint.clearBreakpoint(IDebugBreakPoint.IBreakpointContext)

Parameters

dbgCmds
this is an IDebugBreakPoint.IBreakpointContext object that provides the context needed to be the breakpoint to communicate with the target VM.

Exceptions

DebugTransportException

disable(boolean, IDebugBreakPoint.IBreakpointContext) Method

public void disable(boolean fDisable, 
                    IDebugBreakPoint.IBreakpointContext bpCtx)
throws DebugTransportException
This will either disable or re-enable a breakpoint, depending on the value of fdisable.

Overrides
DefaultBreakpoint.disable(boolean, IDebugBreakPoint.IBreakpointContext)

Parameters

fDisable
this is an IDebugBreakPoint.IBreakpointContext object that provides the context needed to be the breakpoint to communicate with the target VM.

Exceptions

DebugTransportException

documentLoaded() Method

public void documentLoaded()
In init, this breakpoint is about to be associated with an actual file. So we should open the file, and grab an element.

Overrides
SourceBreakpoint.documentLoaded()

documentUnloaded() Method

public void documentUnloaded()
Description copied from SourceBreakpoint.documentUnloaded()
In the case that a file is going away, we need to make sure to persist the current offset info.

Overrides
SourceBreakpoint.documentUnloaded()

reset(Element) Method

public void reset(Element elt)
Overrides
SourceBreakpoint.reset(Element)

resolve() Method

protected String resolve()

supportsProperty(Integer) Method

public synchronized boolean supportsProperty(Integer prop)
Java breakpoints currently support conditions (IDebugBreakPoint.BP_PROP_CONDITION) and expression evaluation (Integer 500, 501, and 502). Those are not public constants in SP2 to avoid making a public API change, but will be moved in the future.

Overrides
DefaultBreakpoint.supportsProperty(Integer)

Parameters

prop
handle to the property

Returns

whether the breakpoint supports the property

syncBreakpoint(IDebugBreakPoint.IBreakpointContext) Method

public void syncBreakpoint(IDebugBreakPoint.IBreakpointContext dbgCmds)
throws DebugTransportException
Description copied from IDebugBreakPoint.syncBreakpoint(IDebugBreakPoint.IBreakpointContext)
This is called to have the Breakpoint synchronize itself with the proxy. This function will be called for each breakpoint as a debugging session begins. It will also be called right after a breakpoint is set, for each project that contains the breakpoint.

Overrides
SourceBreakpoint.syncBreakpoint(IDebugBreakPoint.IBreakpointContext)

Parameters

dbgCmds
this is an IDebugBreakPoint.IBreakpointContext object that provides the context needed to be the breakpoint to communicate with the target VM.

Exceptions

DebugTransportException

toString() Method

public String toString()
Java breakpoints display as "CLASSNAME @ LINENUMBER"

Overrides
SourceBreakpoint.toString()

Returns

something reasonable for the breakpoint view to display

updateLine() Method

public void updateLine()
Description copied from ISourceBreakPoint.updateLine()
Re-syncs the line information with the underlying document

Overrides
SourceBreakpoint.updateLine()