Class DefaultVersionParser

java.lang.Object
org.apache.maven.internal.impl.DefaultVersionParser
All Implemented Interfaces:
Service, VersionParser

@Named @Singleton public class DefaultVersionParser extends Object implements VersionParser
A wrapper class around a resolver version that works as model version parser as well.
  • Constructor Details

  • Method Details

    • parseVersion

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

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

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

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