org.eclipse.modisco.kdm.source.extension.discovery

## Class AbstractRegionDiscoverer2<T>

- java.lang.Object
- - org.eclipse.modisco.infra.discovery.core.AbstractDiscoverer<T>
  - - org.eclipse.modisco.infra.discovery.core.AbstractModelDiscoverer<T>
    - - org.eclipse.modisco.kdm.source.extension.discovery.AbstractRegionDiscoverer2<T>

All Implemented Interfaces:
  IDiscoverer<T>, ISourceRegionNotifier<T>

Direct Known Subclasses:
  AbstractDiscoverJavaModelFromProject

    public abstract class AbstractRegionDiscoverer2<T>
    extends AbstractModelDiscoverer<T>
    implements ISourceRegionNotifier<T>

This abstract discoverer should be reused for each new leaf discoverer which visits some language source code, in order to have the capability to notify the visit of source regions with a generic mechanism. Composite discoverers should not inherit from this class but rather listen to leaf discoverers by using the proposed listening API. See Help Contents or http://wiki.eclipse.org/MoDisco/Components/KDMSourceExtension See also `SourceVisitListener`

### Constructor Summary

Constructors
Constructor and Description
`AbstractRegionDiscoverer2()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addSourceVisitListener(SourceVisitListener sourceVisitListener)` Add a listener to the list of listener
`java.util.List<SourceVisitListener>` `getSourceVisitListeners()` Return the list of `SourceVisitListener`s
`void` `notifySourceRegionVisited(java.lang.String filePath, int startOffset, int endOffset, EObject targetNode)` Notify all listeners that a source region has been visited This method allows not to indicate the startLine and endLine and automatically put them to -1
`void` `notifySourceRegionVisited(java.lang.String filePath, int startOffset, int endOffset, int startLine, int endLine, EObject targetNode)` Notify all listeners that a source region has been visited
`void` `removeSourceVisitListener(SourceVisitListener sourceVisitListener)` Remove the sourceVisitListener from the list of listeners

### Methods inherited from class org.eclipse.modisco.infra.discovery.core.AbstractModelDiscoverer

`discoverElement, getDefaultTargetURI, getTargetModel, getTargetURI, setSerializeTarget, setTargetModel, setTargetURI`

### Methods inherited from class org.eclipse.modisco.infra.discovery.core.AbstractDiscoverer

`isAFolder, isAJavaProject, isAnIFileWithExtension, isAProject, setRefreshSourceBeforeDiscovery`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.modisco.infra.discovery.core.IDiscoverer

`isApplicableTo`

### Constructor Detail

#### AbstractRegionDiscoverer2

    public AbstractRegionDiscoverer2()

### Method Detail

#### notifySourceRegionVisited

    public final void notifySourceRegionVisited(java.lang.String filePath,
                                                int startOffset,
                                                int endOffset,
                                                int startLine,
                                                int endLine,
                                                EObject targetNode)

Description copied from interface: `ISourceRegionNotifier`
Notify all listeners that a source region has been visited

Specified by:
  `notifySourceRegionVisited` in interface `ISourceRegionNotifier<T>`
Parameters:
  `filePath` - The path of the parent compilation unit
  `startOffset` - Start offset of the source code region
  `endOffset` - End offset of the source code region
  `startLine` - First line of the source code region
  `endLine` - Last line of the source code region
  `targetNode` - The corresponding model element

#### notifySourceRegionVisited

    public final void notifySourceRegionVisited(java.lang.String filePath,
                                                int startOffset,
                                                int endOffset,
                                                EObject targetNode)

Description copied from interface: `ISourceRegionNotifier`
Notify all listeners that a source region has been visited This method allows not to indicate the startLine and endLine and automatically put them to -1

Specified by:
  `notifySourceRegionVisited` in interface `ISourceRegionNotifier<T>`
Parameters:
  `filePath` - The path of the parent compilation unit
  `startOffset` - Start offset of the source code region
  `endOffset` - End offset of the source code region
  `targetNode` - The corresponding model element

#### addSourceVisitListener

    public final void addSourceVisitListener(SourceVisitListener sourceVisitListener)

Description copied from interface: `ISourceRegionNotifier`
Add a listener to the list of listener

Specified by:
  `addSourceVisitListener` in interface `ISourceRegionNotifier<T>`

#### removeSourceVisitListener

    public final void removeSourceVisitListener(SourceVisitListener sourceVisitListener)

Description copied from interface: `ISourceRegionNotifier`
Remove the sourceVisitListener from the list of listeners

Specified by:
  `removeSourceVisitListener` in interface `ISourceRegionNotifier<T>`

#### getSourceVisitListeners

    public final java.util.List<SourceVisitListener> getSourceVisitListeners()

Description copied from interface: `ISourceRegionNotifier`
Return the list of `SourceVisitListener`s

Specified by:
  `getSourceVisitListeners` in interface `ISourceRegionNotifier<T>`
Returns:
  The list of `SourceVisitListener`s