Class SemanticVersionParser
java.lang.Object
xyz.apollosoftware.bibliothiki.versioning.schemes.semver.SemanticVersionParser
- All Implemented Interfaces:
VersionParser<SemanticVersion>
A parser for a
SemanticVersion.
This is implemented as a linear (LR) bottom-up parser, similarly to a regular expression however implemented manually for more flexibility in error handling.
This implementation delegates to other parsers defined for pre-release
(SemanticVersion.PreReleaseIdentifier) and build identifiers
(SemanticVersion.BuildIdentifier) in the constructors of those respective classes for
consistency.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull SemanticVersionTry to parse the given version string as aSemanticVersion.
-
Constructor Details
-
SemanticVersionParser
public SemanticVersionParser()Construct aSemanticVersionParser.
-
-
Method Details
-
parse
Try to parse the given version string as aSemanticVersion.- Specified by:
parsein interfaceVersionParser<SemanticVersion>- Parameters:
version- The string to parse.- Returns:
- The parsed
SemanticVersion.
-