01: /**
02: *
03: */package generate.utils;
04:
05: /**
06: * @author sh
07: *
08: */
09: public class Utils {
10:
11: public static String packagename(String className) {
12: int i = className.lastIndexOf('.');
13: if (i > -1)
14: return className.substring(0, i);
15: else
16: return null;
17: }
18:
19: public static String classname(String className) {
20: int i = className.lastIndexOf('.');
21: if (i > -1)
22: return className.substring(i + 1);
23: else
24: return className;
25: }
26:
27: public static String classFileName(String className) {
28: return classname(className) + ".java";
29: }
30:
31: public static String packageStructure(String packageName) {
32: return packagename(packageName).replace('.', '/') + '/';
33: }
34: }
|