Class MappingSupport

java.lang.Object
org.sonatype.maven.polyglot.mapping.MappingSupport
All Implemented Interfaces:
Mapping
Direct Known Subclasses:
XmlMapping

public abstract class MappingSupport extends Object implements Mapping
Support for Mapping implementations.
Since:
0.7
  • Field Details

    • EMPTY

      private static final String[] EMPTY
    • roleHint

      private String roleHint
    • pomNames

      private String[] pomNames
    • acceptOptionKeys

      private String[] acceptOptionKeys
    • acceptLocationExtensions

      private String[] acceptLocationExtensions
    • priority

      private float priority
    • container

      @Requirement private org.codehaus.plexus.PlexusContainer container
    • reader

      private org.apache.maven.model.io.ModelReader reader
    • writer

      private org.apache.maven.model.io.ModelWriter writer
  • Constructor Details

    • MappingSupport

      protected MappingSupport(String roleHint)
  • Method Details

    • getFlavour

      public 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 String[] getAcceptLocationExtensions()
    • setAcceptLocationExtensions

      public void setAcceptLocationExtensions(String... accept)
    • getAcceptOptionKeys

      public String[] getAcceptOptionKeys()
    • setAcceptOptionKeys

      public void setAcceptOptionKeys(String... accept)
    • getPomNames

      public String[] getPomNames()
    • setPomNames

      public void setPomNames(String... names)
    • locatePom

      public File locatePom(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(Map<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 String getLocation(Map<?,?> options)