KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensugar > cube > java2 > PackageHelper


1 /*
2  * JEFFREE: Java(TM) Embedded Framework FREE
3  * Copyright (C) 1999-2003 - Opensugar
4  *
5  * The contents of this file are subject to the Jeffree Public License,
6  * as defined by the file JEFFREE_LICENSE.TXT
7  *
8  * You may not use this file except in compliance with the License.
9  * You may obtain a copy of the License on the Objectweb web site
10  * (www.objectweb.org).
11  *
12  * Software distributed under the License is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
14  * the specific terms governing rights and limitations under the License.
15  *
16  * The Original Code is JEFFREE, including the java package com.opensugar.cube,
17  * released January 1, 2003.
18  *
19  * The Initial Developer of the Original Code is Opensugar.
20  * The Original Code is Copyright Opensugar.
21  * All Rights Reserved.
22  *
23  * Initial developer(s): Pierre Scokaert (Opensugar)
24  * Contributor(s):
25  */

26
27 package com.opensugar.cube.java2;
28
29 public class PackageHelper {
30
31    public static String JavaDoc getName( Class JavaDoc clazz ) {
32       // In Java 2:
33
// return clazz.getPackage().getName();
34
String JavaDoc className = clazz.getName();
35       int n = className.lastIndexOf( "." );
36       return className.substring( 0, n );
37    }
38
39    public static String JavaDoc getImplementationVendor( String JavaDoc packageName ) {
40       // In Java 2:
41
// return Package.getPackage( packageName ).getImplementationVendor();
42
return "???";
43    }
44
45    public static String JavaDoc getImplementationTitle( String JavaDoc packageName ) {
46       // In Java 2:
47
// return Package.getPackage( packageName ).getImplementationTitle();
48
return "???";
49    }
50
51    public static String JavaDoc getImplementationVersion( String JavaDoc packageName ) {
52       // In Java 2:
53
// return Package.getPackage( packageName ).getImplementationVersion();
54
return "???";
55    }
56
57    public static String JavaDoc getSpecificationTitle( String JavaDoc packageName ) {
58       // In Java 2:
59
// return Package.getPackage( packageName ).getSpecificationTitle();
60
return "???";
61    }
62
63    public static String JavaDoc getSpecificationVersion( String JavaDoc packageName ) {
64       // In Java 2:
65
// return Package.getPackage( packageName ).getSpecificationVersion();
66
return null;
67    }
68
69 }
70
Popular Tags