1 /*******************************************************************************
2 * Copyright (c) 2010, 2011 Sonatype, Inc.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Sonatype, Inc. - initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.aether
.version
;
14 * A version scheme that handles interpretation of version strings to facilitate their comparison.
16 public interface VersionScheme
20 * Parses the specified version string, for example "1.0".
22 * @param version The version string to parse, must not be {@code null}.
23 * @return The parsed version, never {@code null}.
24 * @throws InvalidVersionSpecificationException If the string violates the syntax rules of this scheme.
26 Version
parseVersion( String version
)
27 throws InvalidVersionSpecificationException
;
30 * Parses the specified version range specification, for example "[1.0,2.0)".
32 * @param range The range specification to parse, must not be {@code null}.
33 * @return The parsed version range, never {@code null}.
34 * @throws InvalidVersionSpecificationException If the range specification violates the syntax rules of this scheme.
36 VersionRange
parseVersionRange( String range
)
37 throws InvalidVersionSpecificationException
;
40 * Parses the specified version constraint specification, for example "1.0" or "[1.0,2.0),(2.0,)".
42 * @param constraint The constraint specification to parse, must not be {@code null}.
43 * @return The parsed version constraint, never {@code null}.
44 * @throws InvalidVersionSpecificationException If the constraint specification violates the syntax rules of this
47 VersionConstraint
parseVersionConstraint( final String constraint
)
48 throws InvalidVersionSpecificationException
;