@Retention(value=RUNTIME) @Target(value={FIELD,METHOD}) @Indexed public @interface AdaptField
The get access will be rewritten as "v = (OldType)x.fieldY",
the set access will be rewritten as "x.fieldY = (NewType)v".
At runtime, if the type of the value doesn't match up, this will result in
ClassCastException
.
For adopting the return type of the method, see a separate project "bridge method injector" that achieves the goal without the need for runtime transformation.
Copyright © 2018. All rights reserved.