public class ClassTool
extends java.lang.Object
CompareAndSerialize
annotation to designate the class as toolable. The ComparisonOrderField
and
ComparisonOrderMethod
.We generate compareTo method and Serializable interface
implementation with SerialUID. No modifications will affect the operation of the original class.
The original class will be backed up as [OriginalClassName].bak before modification.
TestTooling1
TestTooling2
TODO: check to see if class extends class that implements compareTo, then call superclass compareTo if we
need to add Comparable interface.
If we generate a serialVersionUID we add a default constructor as well.Command line is java -cp rockcksdb.jar;rocksack.jar com.neocoretechs.rocksack.ClassTool yourjavaclass.java
You also need the correct directory structure to match your package naming convention as the tool relies on runtime compilation of the source java. Easy way is to call your package com, create com directory, then specify com/yourjavaclass.java on the command line. Later, change your package name. After running the tool you should see your original source as yourjavaclass.java.bak, the modified class as yourjavaclass.java, and the associated class files from runtime compilation process.
Constructor and Description |
---|
ClassTool() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Must declare extends BEFORE implements.
|
public static void main(java.lang.String[] args) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.lang.IllegalArgumentException, java.io.IOException
args
- java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.lang.IllegalArgumentException
java.io.IOException