Interface ModelVersionParser

All Known Implementing Classes:
DefaultModelVersionParser

public interface ModelVersionParser
Model builder specific version parser. It is intentionally not VersionParser as this is not a service, but at Maven runtime it MAY actually use that service.
Since:
4.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isSnapshot(String version)
    Checks whether a given artifact version is considered a SNAPSHOT or not.
    org.apache.maven.api.Version
    Parses the specified version string, for example "1.0".
    org.apache.maven.api.VersionConstraint
    Parses the specified version constraint specification, for example "1.0" or "[1.0,2.0)".
    org.apache.maven.api.VersionRange
    Parses the specified version range specification, for example "[1.0,2.0)".
  • Method Details

    • parseVersion

      @Nonnull org.apache.maven.api.Version parseVersion(@Nonnull String version)
      Parses the specified version string, for example "1.0".
      Parameters:
      version - the version string to parse, must not be null
      Returns:
      the parsed version, never null
      Throws:
      org.apache.maven.api.services.VersionParserException - if the string violates the syntax rules of this scheme
    • parseVersionRange

      @Nonnull org.apache.maven.api.VersionRange parseVersionRange(@Nonnull String range)
      Parses the specified version range specification, for example "[1.0,2.0)".
      Parameters:
      range - the range specification to parse, must not be null
      Returns:
      the parsed version range, never null
      Throws:
      org.apache.maven.api.services.VersionParserException - if the range specification violates the syntax rules of this scheme
    • parseVersionConstraint

      @Nonnull org.apache.maven.api.VersionConstraint parseVersionConstraint(@Nonnull String constraint)
      Parses the specified version constraint specification, for example "1.0" or "[1.0,2.0)".
      Parameters:
      constraint - the range specification to parse, must not be null
      Returns:
      the parsed version constraint, never null
      Throws:
      org.apache.maven.api.services.VersionParserException - if the range specification violates the syntax rules of this scheme
    • isSnapshot

      boolean isSnapshot(@Nonnull String version)
      Checks whether a given artifact version is considered a SNAPSHOT or not.