Package org.sonatype.maven.polyglot.mapping

## Class MappingSupport

- java.lang.Object
- - org.sonatype.maven.polyglot.mapping.MappingSupport

All Implemented Interfaces:
  `Mapping`

Direct Known Subclasses:
  `XmlMapping`

    public abstract class MappingSupport
    extends java.lang.Object
    implements Mapping

Support for `Mapping` implementations.

Since:
  0.7
Author:
  Jason Dillon

### Field Summary

### Fields inherited from interface org.sonatype.maven.polyglot.mapping.Mapping

`ARTIFACT_ID_PROPERTY, DESCRIPTION_PROPERTY, GROUP_ID_PROPERTY, NAME_PROPERTY, PACKAGING_PROPERTY, PROPERTY_PREFIX, URL_PROPERTY, VERSION_PROPERTY`

### Constructor Summary

Constructors
`protected` `MappingSupport​(java.lang.String roleHint)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `accept​(java.util.Map<java.lang.String,​?> options)` Tests weather this mapping accepts the given option
`java.lang.String[]` `getAcceptLocationExtensions()`
`java.lang.String[]` `getAcceptOptionKeys()`
`java.lang.String` `getFlavour()`
`java.lang.String` `getLocation​(java.util.Map<?,​?> options)`
`java.lang.String[]` `getPomNames()`
`float` `getPriority()` get the priority of this mapping, higher priorities are given precedence over those with lower priority, the default priority is 0
`org.apache.maven.model.io.ModelReader` `getReader()`
`org.apache.maven.model.io.ModelWriter` `getWriter()`
`java.io.File` `locatePom​(java.io.File dir)` Locates the pom in the given directory
`void` `setAcceptLocationExtensions​(java.lang.String... accept)`
`void` `setAcceptOptionKeys​(java.lang.String... accept)`
`void` `setPomNames​(java.lang.String... names)`
`protected void` `setPriority​(float priority)`

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

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

### Methods inherited from interface org.sonatype.maven.polyglot.mapping.Mapping

`getEnhancementProperties`

### Constructor Detail

#### MappingSupport

    protected MappingSupport​(java.lang.String roleHint)

### Method Detail

#### getFlavour

    public java.lang.String getFlavour()

Specified by:
  `getFlavour` in interface `Mapping`
Returns:
  the flavor used to identify this mapping (e.g. xml, json, yaml, ...)

#### getReader

    public org.apache.maven.model.io.ModelReader getReader()

Specified by:
  `getReader` in interface `Mapping`
Returns:
  the `ModelReader` responsible for reading poms returned by the `Mapping.locatePom(File)` method

#### getWriter

    public org.apache.maven.model.io.ModelWriter getWriter()

Specified by:
  `getWriter` in interface `Mapping`
Returns:
  the `ModelWriter` responsible for writing poms returned by the `Mapping.locatePom(File)` method

#### getAcceptLocationExtensions

    public java.lang.String[] getAcceptLocationExtensions()

#### setAcceptLocationExtensions

    public void setAcceptLocationExtensions​(java.lang.String... accept)

#### getAcceptOptionKeys

    public java.lang.String[] getAcceptOptionKeys()

#### setAcceptOptionKeys

    public void setAcceptOptionKeys​(java.lang.String... accept)

#### getPomNames

    public java.lang.String[] getPomNames()

#### setPomNames

    public void setPomNames​(java.lang.String... names)

#### locatePom

    public java.io.File locatePom​(java.io.File dir)

Description copied from interface: `Mapping`
Locates the pom in the given directory

Specified by:
  `locatePom` in interface `Mapping`
Parameters:
  `dir` - the directory to locate the pom for
Returns:
  the located pom or `null` if none was found by this mapping

#### accept

    public boolean accept​(java.util.Map<java.lang.String,​?> options)

Description copied from interface: `Mapping`
Tests weather this mapping accepts the given option

Specified by:
  `accept` in interface `Mapping`
Parameters:
  `options` - the options to use
Returns:
  `true` if options are accepted, `false` otherwise

#### getPriority

    public float getPriority()

Description copied from interface: `Mapping`
get the priority of this mapping, higher priorities are given precedence over those with lower priority, the default priority is 0

Specified by:
  `getPriority` in interface `Mapping`
Returns:
  the priority

#### setPriority

    protected void setPriority​(float priority)

#### getLocation

    public java.lang.String getLocation​(java.util.Map<?,​?> options)