Class 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
    • Field Detail

      • EMPTY

        private static final java.lang.String[] EMPTY
      • roleHint

        private java.lang.String roleHint
      • pomNames

        private java.lang.String[] pomNames
      • acceptOptionKeys

        private java.lang.String[] acceptOptionKeys
      • acceptLocationExtensions

        private java.lang.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 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)