1 |
/* |
/* |
2 |
Copyright (c) 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc. |
Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
74 |
exception.printStackTrace(); |
exception.printStackTrace(); |
75 |
} |
} |
76 |
else { |
else { |
77 |
usage(); |
System.exit(1); |
78 |
} |
} |
79 |
} |
} |
80 |
} |
} |
82 |
public boolean run() { |
public boolean run() { |
83 |
parseOptions(); |
parseOptions(); |
84 |
if (next >= args.length) { |
if (next >= args.length) { |
85 |
return (false); |
error("no class names found"); |
86 |
} |
} |
87 |
for (int i = next; i < args.length; i++) { |
for (int i = next; i < args.length; i++) { |
88 |
try { |
try { |
647 |
|
|
648 |
out.println(); |
out.println(); |
649 |
|
|
650 |
// getOpertions method |
// getOperations method |
651 |
out.print("public java.rmi.server.Operation[] getOperations() {"); |
out.print("public java.rmi.server.Operation[] getOperations() {"); |
652 |
ctrl.indent(); |
ctrl.indent(); |
653 |
out.print("return ((java.rmi.server.Operation[]) operations.clone());"); |
out.print("return ((java.rmi.server.Operation[]) operations.clone());"); |
887 |
String arg = args[next]; |
String arg = args[next]; |
888 |
next++; |
next++; |
889 |
|
|
890 |
|
// Accept `--' options if they look long enough. |
891 |
|
if (arg.length() > 3 && arg.charAt(0) == '-' |
892 |
|
&& arg.charAt(1) == '-') |
893 |
|
arg = arg.substring(1); |
894 |
|
|
895 |
if (arg.equals("-keep")) { |
if (arg.equals("-keep")) { |
896 |
keep = true; |
keep = true; |
897 |
} |
} |
925 |
else if (arg.equals("-classpath")) { |
else if (arg.equals("-classpath")) { |
926 |
next++; |
next++; |
927 |
} |
} |
928 |
|
else if (arg.equals("-help")) { |
929 |
|
usage(); |
930 |
|
} |
931 |
|
else if (arg.equals("-version")) { |
932 |
|
System.out.println("rmic (GNU " |
933 |
|
+ System.getProperty("java.vm.name") |
934 |
|
+ ") " |
935 |
|
+ System.getProperty("java.vm.version")); |
936 |
|
System.out.println(); |
937 |
|
System.out.println("Copyright 1996, 1997, 1998, 1999, 2001, 2002 Free Software Foundation"); |
938 |
|
System.out.println("This is free software; see the source for copying conditions. There is NO"); |
939 |
|
System.out.println("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."); |
940 |
|
System.exit(0); |
941 |
|
} |
942 |
else if (arg.equals("-d")) { |
else if (arg.equals("-d")) { |
943 |
destination = args[next]; |
destination = args[next]; |
944 |
next++; |
next++; |
946 |
else if (arg.charAt(1) == 'J') { |
else if (arg.charAt(1) == 'J') { |
947 |
} |
} |
948 |
else { |
else { |
949 |
System.err.println("Unknown option: " + arg); |
error("unrecognized option `" + arg + "'"); |
950 |
} |
} |
951 |
} |
} |
952 |
} |
} |
953 |
|
|
954 |
|
private static void error(String message) { |
955 |
|
System.err.println("rmic: " + message); |
956 |
|
System.err.println("Try `rmic --help' for more information."); |
957 |
|
System.exit(1); |
958 |
|
} |
959 |
|
|
960 |
private static void usage() { |
private static void usage() { |
961 |
System.out.println( |
System.out.println( |
962 |
"usage: rmic [-options] classes\n" + |
"Usage: rmic [OPTION]... CLASS...\n" + |
963 |
"Options are:\n" + |
"\n" + |
964 |
" -keep Don't delete any intermediate files\n" + |
" -keep Don't delete any intermediate files\n" + |
965 |
" -keepgenerated Same as -keep\n" + |
" -keepgenerated Same as -keep\n" + |
966 |
" -v1.1 Java 1.1 style stubs only\n" + |
" -v1.1 Java 1.1 style stubs only\n" + |
974 |
" -classpath <path> * Use given path as classpath\n" + |
" -classpath <path> * Use given path as classpath\n" + |
975 |
" -d <directory> Specify where to place generated classes\n" + |
" -d <directory> Specify where to place generated classes\n" + |
976 |
" -J<flag> * Pass flag to Java\n" + |
" -J<flag> * Pass flag to Java\n" + |
977 |
" * Option currently ignored" |
" -help Print this help, then exit\n" + |
978 |
|
" -version Print version number, then exit\n" + |
979 |
|
"\n" + |
980 |
|
" * Option currently ignored\n" + |
981 |
|
"Long options can be used with `--option' form as well." |
982 |
); |
); |
983 |
|
System.exit(0); |
984 |
} |
} |
985 |
|
|
986 |
static class MethodRef |
static class MethodRef |