org.eclipse.modisco.kdm.source.discoverer

## Class DiscoverSourceModelFromResource

- java.lang.Object
- - org.eclipse.modisco.infra.discovery.core.AbstractDiscoverer<T>
  - - org.eclipse.modisco.infra.discovery.core.AbstractModelDiscoverer<IResource>
    - - org.eclipse.modisco.kdm.source.discoverer.DiscoverSourceModelFromResource

All Implemented Interfaces:
  IDiscoverer<IResource>

    public class DiscoverSourceModelFromResource
    extends AbstractModelDiscoverer<IResource>

A discoverer for building a model conforming to kdm.source metamodel from a files container ( `IContainer` instance or `File` instance.

### Constructor Summary

Constructors
Constructor and Description
`DiscoverSourceModelFromResource()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `discoverElement(java.io.File directory, IProgressMonitor monitor)` Alternate discoverer service with File as input instead of IFile.
`boolean` `isApplicableTo(IResource resource)` To determine if the source object can be handled by the discoverer.

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

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

### Constructor Detail

#### DiscoverSourceModelFromResource

    public DiscoverSourceModelFromResource()

### Method Detail

#### isApplicableTo

    public boolean isApplicableTo(IResource resource)

Description copied from interface: `IDiscoverer`
To determine if the source object can be handled by the discoverer. Each discoverer has to implement this method with its own criteria to filter the selected object.

Some usual implementations are proposed on `AbstractDiscoverer`.

Parameters:
  `resource` - the selected object.
Returns:
  `true` if the selected object is managed by this discoverer, `false` otherwise.

#### discoverElement

    public void discoverElement(java.io.File directory,
                                IProgressMonitor monitor)
                         throws DiscoveryException

Alternate discoverer service with File as input instead of IFile. If you want to discover an `IFile`, use `IDiscoverer.discoverElement(Object, IProgressMonitor)` instead

Specified by:
  `discoverElement` in interface `IDiscoverer<IResource>`
Overrides:
  `discoverElement` in class `AbstractModelDiscoverer<IResource>`
Parameters:
  `directory` - the directory to discover
  `monitor` - a `progress monitor` (may be a `NullProgressMonitor` if progress monitoring is not desired)
Throws:
  `DiscoveryException`