/** * To create a protobuf proxy class for target class. * * @param <T> target object type to be proxied. * @param cls target object class * @param debug true will print generate java source code * @param path the path * @param compiler the compiler * @param codeGenerator the code generator * @return proxy instance object. */ public static <T> Codec<T> create(Class<T> cls, boolean debug, File path, Compiler compiler, ICodeGenerator codeGenerator) { DEBUG_CONTROLLER.set(debug); OUTPUT_PATH.set(path); try { return doCreate(cls, isDebugEnabled(), compiler, codeGenerator); } finally { DEBUG_CONTROLLER.remove(); OUTPUT_PATH.remove(); } }