# com.bea.ide.debug
IDebugBreakPoint Interface

public interface IDebugBreakPoint
extends `Serializable`

General interface of an object that represents a break point. This interface allows you to add specialized handling for breakpoints above and beyond what is offered by the base breakpoint implementations. Creating a new breakpoint implementation will allow you to get a hook into the debugging processing at breakpoint sync time, as well as when the breakpoint gets hit. This layer also allows you to create a mapping between the file a user views to set breakpoints to the file the breakpoints actually get set in. This can be useful if you are taking advantage of autogenerated files.

`IDebugBreakPoint`s will be serialized and deserialized to persist between IDE sessions. `IDebugBreakpoint`s are created through the `IDebugDriver` interface for a given document.

All Known Implementing Classes
  `DefaultBreakpoint`, `SourceBreakpoint`

All Superinterfaces
  `Serializable`

All Known Subinterfaces
  `IExceptionBreakPoint`, `ISourceBreakPoint`

## Nested Class Summary

`public static interface` | `IDebugBreakPoint.IBreakpointContext` an interface passed into various breakpoint methods, as a way for the breakpoint to communicate with the target VM.

## Field Summary

`public static final `Integer`` | `BP_PROP_CONDITION` property on the breakpoint denoting a conditional break.
`public static final int` | `INVALID_ID` This is the invalid id constant.
`public static final `String`` | `PROP_ERROR_MESSAGE` This property is the current error message.

## 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` dbgCmds) This will either disable or re-enable a breakpoint, depending on the value of `fDisable`.
`public `String`` | `getErrorMessage`() Error messages indicate something went wrong with the breakpoint, like the evaluation of the conditional expression did not result in a boolean
`public int` | `getId`() This Unique ID will be used to keep breakpoints in the IDE in sync with breakpoints in the proxy
`public `Map`` | `getProperties`() This method gets a list of the breakpoint's properties.
`public `String`` | `getProperty`(`Integer` prop) This method sets a property on the breakpoint.
`public boolean` | `isDisabled`() This will return whether the breakpoint is enabled or disabled.
`public boolean` | `isValid`() The breakpoint is not valid if it is known to be on a line that cannot be hit when debugging.
`public void` | `setErrorMessage`(`String` message) Sets the error message describing why a breakpoint could not be set.
`public void` | `setId`(int i) This Unique ID will be used to keep breakpoints in the IDE in sync with breakpoints in the proxy
`public void` | `setProperties`(`Map` props) This method will add a set of properties to the breakpoint.
`public `String`` | `setProperty`(`Integer` prop, `String` val) This method sets a property on a breakpoint.
`public boolean` | `supportsProperty`(`Integer` prop) This method returns whether a breakpoint supports a given property or not.
`public void` | `syncBreakpoint`(`IDebugBreakPoint.IBreakpointContext` dbgCmds) This is called to have the Breakpoint synchronize itself with the proxy.

## Field Detail

### BP_PROP_CONDITION

    public static final Integer BP_PROP_CONDITION

  property on the breakpoint denoting a conditional break. If set, this breakpoint will only be hit if the condition evaluates to "`true`".

### INVALID_ID

    public static final int INVALID_ID

  This is the invalid id constant. Any breakpoint that is currently in use will not have an ID equal to this.

### PROP_ERROR_MESSAGE

    public static final String PROP_ERROR_MESSAGE

  This property is the current error message. If you register to get change requests for this property, you will get notified whenever you get an error for the conditional expression on a breakpoint.

## Method Detail

### breakpointHit() Method

    public IDebugInstructionPoint 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.

#### 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

This is called to have the Breakpoint clear itself with the proxy. This function will be called when a breakpoint in being removed.

#### 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``
  if the target VM could not be reached.

### disable(boolean, IDebugBreakPoint.IBreakpointContext) Method

    public void disable(boolean fDisable,
                        IDebugBreakPoint.IBreakpointContext dbgCmds)
         throws DebugTransportException

This will either disable or re-enable a breakpoint, depending on the value of `fDisable`. This method is also responsible for sending a message to the proxy telling it whether or not to pay attention to this breakpoint. This is only really called by the `IDebugClient`, anywhere else that wants to enable or disable a breakpoint should call disableBreakpoint on `IDebugClient```.

#### 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``
  if the target VM could not be reached.

### getErrorMessage() Method

    public String getErrorMessage()

Error messages indicate something went wrong with the breakpoint, like the evaluation of the conditional expression did not result in a boolean

#### Returns

if set, message from debugger regarding the status of the breakpoint, null otherwise

### getId() Method

    public int getId()

This Unique ID will be used to keep breakpoints in the IDE in sync with breakpoints in the proxy

#### Returns

the unique id that will be used for this breakpoint durring the debugging session.

### getProperties() Method

    public Map getProperties()

This method gets a list of the breakpoint's properties.

#### Returns

gets the entire `Map``` of properties set on this breakpoint.

### getProperty(Integer) Method

    public String getProperty(Integer prop)

This method sets a property on the breakpoint.

#### Parameters

prop
  the value for the property you want, e.g. `IDebugBreakPoint.BP_PROP_CONDITION```.

#### Returns

the property value you are looking for, or `null` if one is not present.

### isDisabled() Method

    public boolean isDisabled()

This will return whether the breakpoint is enabled or disabled.

#### Returns

true - if the breakpoint is disabled false - if the breakpoint is enabled.

### isValid() Method

    public boolean isValid()

The breakpoint is not valid if it is known to be on a line that cannot be hit when debugging. There are lines that will not be hit, but we cannot currently detect.

#### Returns

true if the breakpoint thinks it is on a valid line false if the breakpoint knows it is not on a valid line.

### setErrorMessage(String) Method

    public void setErrorMessage(String message)

Sets the error message describing why a breakpoint could not be set.

#### Parameters

message
  message from debugger, if any, regarding the status of the breakpoint. May be null.

### setId(int) Method

    public void setId(int i)

This Unique ID will be used to keep breakpoints in the IDE in sync with breakpoints in the proxy

#### Parameters

i
  the unique id that will be used for this breakpoint durring the debugging session.

### setProperties(Map) Method

    public void setProperties(Map props)

This method will add a set of properties to the breakpoint. If any of the properties already exist, this will override them.

#### Parameters

props
  the entire `Map``` of properties to set on this breakpoint.

### setProperty(Integer, String) Method

    public String setProperty(Integer prop,
                              String val)

This method sets a property on a breakpoint.

#### Parameters

prop
  the value for the property you want to set, e.g. `IDebugBreakPoint.BP_PROP_CONDITION```.

val
  the new value for this property.

#### Returns

the property replaced, or `null` if there was no previous value.

### supportsProperty(Integer) Method

    public boolean supportsProperty(Integer prop)

This method returns whether a breakpoint supports a given property or not.

#### Parameters

prop
  the value for the property you want, e.g. `IDebugBreakPoint.BP_PROP_CONDITION```.

#### Returns

true if this breakpoint supports this property false if this breakpoint does not support this property.

### syncBreakpoint(IDebugBreakPoint.IBreakpointContext) Method

    public void syncBreakpoint(IDebugBreakPoint.IBreakpointContext dbgCmds)
         throws DebugTransportException

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.

#### 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``
  if the target VM could not be reached.