public static Version parse(String s) throws VersionFormatException {
		if (s == null) {
			throw new NullPointerException(s);
		} else if (s.equals("*")) {
			return ALL;
		} else {
			try {
				Modifier m = Modifier.Release;
				final int i = s.indexOf('-');
				if (i > 0) {
					m = Modifier.parse(s.substring(i + 1));
					s = s.substring(0, i);
				}
				final String[] parts = s.split("[.]");
				final int revision = parts.length == 3 ? Integer
						.parseInt(parts[2]) : 0;
				return new Version(Integer.parseInt(parts[0]),
						Integer.parseInt(parts[1]), revision, m);
			} catch (final Exception e) {
				throw VersionFormatException.forInputString(s);
			}
		}
	}