org.eclipse.modisco.infra.discovery.core

## Class AbstractModelDiscoverer<T>

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

Type Parameters:
  `T` - the type of source of the discovery

All Implemented Interfaces:
  IDiscoverer<T>

Direct Known Subclasses:
  AbstractComposedKDMSourceDiscoverer2, AbstractDeploymentDescriptorDiscoverer, AbstractJspDiscoverer, AbstractProjectDeploymentDescriptorDiscoverer, AbstractRegionDiscoverer2, DiscoverEclipsePluginFromJavaProject2, DiscoverEclipsePluginFromProject, DiscoverJavaModelFromClassFile, DiscoverJavaModelFromLibrary, DiscoverKDMModelFromJavaModel, DiscoverKDMModelFromJavaProject, DiscoverKDMModelFromProject, DiscoverMethodCallsModelFromJavaModel, DiscoverMethodCallsModelFromJavaProject, DiscoverSourceModelFromJavaElement, DiscoverSourceModelFromResource, DiscoverUmlModelFromJavaProject, DiscoverUmlModelFromKdmModel, DiscoverUmlModelFromProject, DiscoverUmlModelWithBidirectionalAssociationsFromJavaProject, DiscoverUmlModelWithBidirectionalAssociationsFromProject, DiscoverUmlModelWithRealTypesFromJavaProject, ManifestModelDiscoverer2, PropertiesModelDiscoverer2, XMLModelDiscoverer

    public abstract class AbstractModelDiscoverer<T>
    extends AbstractDiscoverer<T>

A base implementation for a category of discoverers which handle some resulting model. It proposes to centralize some usual parameters :

- A model container (`org.eclipse.emf.ecore.resource.Resource`), usually an output of the discovery but which might be provided also as input.
- A boolean indicating if some serialization is wished.
- A location for optional serialization ( `org.eclipse.emf.common.util.URI`)

### Constructor Summary

Constructors
Constructor and Description
`AbstractModelDiscoverer()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `discoverElement(T source, IProgressMonitor monitor)` Discovers the model and saves the result model if `serialization is required`.
`URI` `getDefaultTargetURI()` The URI that will be used if the targetURI is `null` or empty.
`Resource` `getTargetModel()`
`URI` `getTargetURI()`
`void` `setSerializeTarget(boolean serializeTarget)`
`void` `setTargetModel(Resource targetModel)`
`void` `setTargetURI(URI targetURI)`

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

#### AbstractModelDiscoverer

    public AbstractModelDiscoverer()

### Method Detail

#### getTargetModel

    @Parameter(name="TARGET_MODEL",
               requiresInputValue=false,
               description="A model container; usually an output of the discovery but may also be provided as input.")
    public Resource getTargetModel()

#### setTargetModel

    @Parameter(name="TARGET_MODEL")
    public void setTargetModel(Resource targetModel)

#### setSerializeTarget

    @Parameter(name="SERIALIZE_TARGET",
               requiresInputValue=false,
               description="Whether to serialize the target model. The save behavior depends on the Discoverer implementation. The standard behavior is to use XMI serialization.")
    public void setSerializeTarget(boolean serializeTarget)

#### getTargetURI

    public URI getTargetURI()

#### setTargetURI

    @Parameter(name="TARGET_URI",
               requiresInputValue=false,
               description="A target location for optional model serialization. Save behavior depends on the Discoverer implementation.")
    public void setTargetURI(URI targetURI)

#### discoverElement

    public final void discoverElement(T source,
                                      IProgressMonitor monitor)
                               throws DiscoveryException

Discovers the model and saves the result model if `serialization is required`.

Specified by:
  `discoverElement` in interface `IDiscoverer<T>`
Overrides:
  `discoverElement` in class `AbstractDiscoverer<T>`
Parameters:
  `source` - the selected object.
  `monitor` - a progress monitor used to report progress and respond to cancellation. May be a `NullProgressMonitor` if no monitor is to be used.
Throws:
  `DiscoveryException` - abnormal discovery process termination

#### getDefaultTargetURI

    public URI getDefaultTargetURI()

The URI that will be used if the targetURI is `null` or empty.