/** * To create a protobuf proxy class for target class. * * @param <T> generic type * @param cls target class to parse <code>@Protobuf</code> annotation * @return {@link Codec} instance proxy */ public static <T> Codec<T> create(Class<T> cls) { return create(cls, isDebugEnabled()); }
/** * 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(); } }
/** * To create a protobuf proxy class for target class. * * @param <T> generic type * @param cls target class to parse <code>@Protobuf</code> annotation * @param compiler the compiler * @param codeGenerator the code generator * @return {@link Codec} instance proxy */ public static <T> Codec<T> create(Class<T> cls, Compiler compiler, ICodeGenerator codeGenerator) { return create(cls, isDebugEnabled(), null, compiler, getCodeGenerator(cls)); }