Class DefaultModelVersionParser

java.lang.Object
org.apache.maven.repository.internal.DefaultModelVersionParser
All Implemented Interfaces:
ModelVersionParser

@Named @Singleton public class DefaultModelVersionParser extends Object implements ModelVersionParser
  • Constructor Details

    • DefaultModelVersionParser

      @Inject public DefaultModelVersionParser(org.eclipse.aether.version.VersionScheme versionScheme)
  • Method Details

    • parseVersion

      public Version parseVersion(String version)
      Description copied from interface: ModelVersionParser
      Parses the specified version string, for example "1.0".
      Specified by:
      parseVersion in interface ModelVersionParser
      Parameters:
      version - the version string to parse, must not be null
      Returns:
      the parsed version, never null
    • parseVersionRange

      public VersionRange parseVersionRange(String range)
      Description copied from interface: ModelVersionParser
      Parses the specified version range specification, for example "[1.0,2.0)".
      Specified by:
      parseVersionRange in interface ModelVersionParser
      Parameters:
      range - the range specification to parse, must not be null
      Returns:
      the parsed version range, never null
    • isSnapshot

      public boolean isSnapshot(String version)
      Description copied from interface: ModelVersionParser
      Checks whether a given artifact version is considered a SNAPSHOT or not.
      Specified by:
      isSnapshot in interface ModelVersionParser
    • checkSnapshot

      public static boolean checkSnapshot(String version)
    • parseVersionConstraint

      public VersionConstraint parseVersionConstraint(String constraint)
      Description copied from interface: ModelVersionParser
      Parses the specified version constraint specification, for example "1.0" or "[1.0,2.0)".
      Specified by:
      parseVersionConstraint in interface ModelVersionParser
      Parameters:
      constraint - the range specification to parse, must not be null
      Returns:
      the parsed version constraint, never null