org.eclipse.modisco.xml.discoverer

## Class XMLModelDiscoverer

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

All Implemented Interfaces:
  IDiscoverer<IFile>

    public class XMLModelDiscoverer
    extends AbstractModelDiscoverer<IFile>

Discover generic XML model action.

### Field Summary

Fields
`static java.lang.String` `ID`

### Constructor Summary

Constructors
Constructor and Description
`XMLModelDiscoverer()`

### Method Summary

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

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

### Field Detail

#### ID

    public static final java.lang.String ID

See Also:
  Constant Field Values

### Constructor Detail

#### XMLModelDiscoverer

    public XMLModelDiscoverer()

### Method Detail

#### setIgnoreWhitespace

    @Parameter(name="IGNORE_WHITESPACE",
               description="Whether to ignore whitespace in text portions.")
    public void setIgnoreWhitespace(boolean ignoreWhitespace)

#### setLightweightModel

    @Parameter(name="LIGHTWEIGHT",
               description="Minimize the memory use of the obtained model by ignoring comments and text portions consisting only of indentation or line delimiters.")
    public void setLightweightModel(boolean lightweightModel)

#### isApplicableTo

    public boolean isApplicableTo(IFile file)

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:
  `file` - the selected object.
Returns:
  `true` if the selected object is managed by this discoverer, `false` otherwise.

#### discoverElement

    public void discoverElement(java.io.File file,
                                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<IFile>`
Overrides:
  `discoverElement` in class `AbstractModelDiscoverer<IFile>`
Parameters:
  `file` - the file to discover
  `monitor` - a `progress monitor` (may be a `NullProgressMonitor` if progress monitoring is not desired)
Throws:
  `DiscoveryException`