Class to use annotation tooling for RockSack to generate the necessary fields and methods for
storage and retrieval under the java.lang.Comparable interface as used throughout the language.
The ordering of the keys is defined here as by the annotation order fields. We use the
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.