com.sun.jini.tool
Class CheckSer
java.lang.Object
com.sun.jini.tool.CheckSer
public class CheckSer
- extends Object
Tool to check for serializable classes that do not have explicit
serialVersionUID
fields.
- Author:
- Sun Microsystems, Inc.
Method Summary |
static void |
check(String dir,
int strip)
Checks the class file directory hierarchy starting from the specified
directory. |
private static void |
checkClass(String file,
int strip)
|
private static String |
getString(String key)
|
static void |
main(String[] args)
Checks class file directory hierarchies for serializable classes
that do not have explicit serialVersionUID fields,
and prints the names of such classes to the standard output stream. |
private static void |
print(String key,
String val)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MASK
private static final int MASK
- See Also:
- Constant Field Values
resources
private static ResourceBundle resources
resinit
private static boolean resinit
CheckSer
public CheckSer()
main
public static void main(String[] args)
- Checks class file directory hierarchies for serializable classes
that do not have explicit
serialVersionUID
fields,
and prints the names of such classes to the standard output stream.
The only options are zero or more filenames that specify the roots
of directory hierarchies; if no filenames are specified, the single
root /vob/jive/classes
is used. In those hierarchies,
each file with a name ending in the suffix .class
is
treated as a class file; the corresponding class name is obtained
from the filename by stripping off both the original prefix root
filename and the .class
suffix, and replacing each file
separator character with a period (.
). Each such class
is loaded from the class loader of this tool. If the class is not an
interface, directly or indirectly implements Serializable
,
and does not have a declared static
final
field named serialVersionUID
, then the name of the class
is printed to the standard output stream.
- Parameters:
args
- the roots of directory hierarchies
check
public static void check(String dir,
int strip)
- Checks the class file directory hierarchy starting from the specified
directory. In the hierarchy, each file with a name ending in the
suffix
.class
is treated as a class file; the
corresponding class name is obtained from the filename by stripping
off the first strip
characters of prefix and the
.class
suffix, and replacing each file separator
character with a period (.
). Each such class is loaded
from the class loader of this tool. If the class is not an interface,
directly or indirectly implements Serializable
, and does not
have a declared static
final
field named
serialVersionUID
, then the name of the class is printed
to the standard output stream.
- Parameters:
dir
- directory hierarchy rootstrip
- number of characters of prefix to strip from each
class file name
checkClass
private static void checkClass(String file,
int strip)
getString
private static String getString(String key)
print
private static void print(String key,
String val)
Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.