Interface Mapping
-
- All Known Implementing Classes:
AtomMapping,MappingSupport,XmlMapping,XMLMapping
public interface MappingProvides a mapping to polyglot specific models.- Since:
- 0.7
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringARTIFACT_ID_PROPERTYstatic java.lang.StringDESCRIPTION_PROPERTYstatic java.lang.StringGROUP_ID_PROPERTYstatic java.lang.StringNAME_PROPERTYstatic java.lang.StringPACKAGING_PROPERTYstatic java.lang.StringPROPERTY_PREFIXstatic java.lang.StringURL_PROPERTYstatic java.lang.StringVERSION_PROPERTY
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanaccept(java.util.Map<java.lang.String,?> options)Tests weather this mapping accepts the given optiondefault java.util.PropertiesgetEnhancementProperties(java.util.Map<java.lang.String,?> options)A properties object can enhance the returned polyglot model by e.g.java.lang.StringgetFlavour()floatgetPriority()get the priority of this mapping, higher priorities are given precedence over those with lower priority, the default priority is 0org.apache.maven.model.io.ModelReadergetReader()org.apache.maven.model.io.ModelWritergetWriter()java.io.FilelocatePom(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
nullif 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:
trueif options are accepted,falseotherwise
-
getReader
org.apache.maven.model.io.ModelReader getReader()
- Returns:
- the
ModelReaderresponsible for reading poms returned by thelocatePom(File)method
-
getWriter
org.apache.maven.model.io.ModelWriter getWriter()
- Returns:
- the
ModelWriterresponsible for writing poms returned by thelocatePom(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 areARTIFACT_ID_PROPERTY, empty property will be interpreted as not givenGROUP_ID_PROPERTY, empty property will be interpreted as not givenVERSION_PROPERTY, empty property will be interpreted as not givenPACKAGING_PROPERTY, empty property will be interpreted as not givenNAME_PROPERTY, empty property will be interpreted as not givenDESCRIPTION_PROPERTY, empty property will be interpreted as not givenURL_PROPERTY, empty property will be interpreted as not given
PROPERTY_PREFIXit 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
nullif no properties exits
-
-