Package org.sonatype.maven.polyglot.mapping

## Interface Mapping

All Known Implementing Classes:
  `MappingSupport`, `XmlMapping`

    public interface Mapping

Provides a mapping to polyglot specific models.

Since:
  0.7
Author:
  Jason Dillon

### Field Summary

Fields
`static java.lang.String` `ARTIFACT_ID_PROPERTY`
`static java.lang.String` `DESCRIPTION_PROPERTY`
`static java.lang.String` `GROUP_ID_PROPERTY`
`static java.lang.String` `NAME_PROPERTY`
`static java.lang.String` `PACKAGING_PROPERTY`
`static java.lang.String` `PROPERTY_PREFIX`
`static java.lang.String` `URL_PROPERTY`
`static java.lang.String` `VERSION_PROPERTY`

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`boolean` `accept​(java.util.Map<java.lang.String,​?> options)` Tests weather this mapping accepts the given option
`default java.util.Properties` `getEnhancementProperties​(java.util.Map<java.lang.String,​?> options)` A properties object can enhance the returned polyglot model by e.g.
`java.lang.String` `getFlavour()`
`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

### Field Detail

#### NAME_PROPERTY

    static final java.lang.String NAME_PROPERTY

See Also:
  Constant Field Values

#### DESCRIPTION_PROPERTY

    static final java.lang.String DESCRIPTION_PROPERTY

See Also:
  Constant Field Values

#### URL_PROPERTY

    static final java.lang.String URL_PROPERTY

See Also:
  Constant Field Values

#### PACKAGING_PROPERTY

    static final java.lang.String PACKAGING_PROPERTY

See Also:
  Constant Field Values

#### VERSION_PROPERTY

    static final java.lang.String VERSION_PROPERTY

See Also:
  Constant Field Values

#### GROUP_ID_PROPERTY

    static final java.lang.String GROUP_ID_PROPERTY

See Also:
  Constant Field Values

#### ARTIFACT_ID_PROPERTY

    static final java.lang.String ARTIFACT_ID_PROPERTY

See Also:
  Constant Field Values

#### PROPERTY_PREFIX

    static final java.lang.String PROPERTY_PREFIX

See Also:
  Constant Field Values

### Method Detail

#### locatePom

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

Locates the pom in the given directory

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

#### accept

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

Tests weather this mapping accepts the given option

Parameters:
  `options` - the options to use
Returns:
  `true` if options are accepted, `false` otherwise

#### getReader

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

Returns:
  the `ModelReader` responsible for reading poms returned by the `locatePom(File)` method

#### getWriter

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

Returns:
  the `ModelWriter` responsible for writing poms returned by the `locatePom(File)` method

#### getPriority

    float getPriority()

get the priority of this mapping, higher priorities are given precedence over those with lower priority, the default priority is 0

Returns:
  the priority

#### getFlavour

    java.lang.String getFlavour()

Returns:
  the flavor used to identify this mapping (e.g. xml, json, yaml, ...)

#### getEnhancementProperties

    default java.util.Properties getEnhancementProperties​(java.util.Map<java.lang.String,​?> options)

A properties object can enhance the returned polyglot model by e.g. a user defined file read by the mapping, supported keys are

- `ARTIFACT_ID_PROPERTY`, empty property will be interpreted as not given
- `GROUP_ID_PROPERTY`, empty property will be interpreted as not given
- `VERSION_PROPERTY`, empty property will be interpreted as not given
- `PACKAGING_PROPERTY`, empty property will be interpreted as not given
- `NAME_PROPERTY`, empty property will be interpreted as not given
- `DESCRIPTION_PROPERTY`, empty property will be interpreted as not given
- `URL_PROPERTY`, empty property will be interpreted as not given

other keys are possible but will be silently ignored. If a property starts with `PROPERTY_PREFIX` it will be interpreted as an enhancement to the properties of the model by removing the prefix and using its value as-is.

Returns:
  a properties object that enhances the the generated model (e.g. by a user provided file) or `null` if no properties exits