KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > internal > baseadaptor > InvalidVersion


1 /*******************************************************************************
2  * Copyright (c) 2004, 2006 IBM Corporation and others.
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
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.osgi.internal.baseadaptor;
13
14 import org.osgi.framework.Version;
15
16 /**
17  * This class is used to hold invalid version strings. This is used to support
18  * OSGi R3 bundles which could have an invalid Bundle-Version header. An
19  * InvalidVersion always has a value of 0.0.0.
20  */

21 public class InvalidVersion extends Version {
22     private String JavaDoc invalidVersion;
23     /**
24      * Constructs a BadVersion using the specified invalid version string.
25      * @param badVersion an invalid version string.
26      */

27     public InvalidVersion(String JavaDoc badVersion) {
28         super(0, 0, 0, null);
29         this.invalidVersion = badVersion;
30     }
31
32     /**
33      * Returns the invalid version string.
34      * @return the invalid version string.
35      */

36     public String JavaDoc getInvalidVersion() {
37         return invalidVersion;
38     }
39
40     public String JavaDoc toString() {
41         return invalidVersion;
42     }
43 }
44
Popular Tags