public final class ProtobufProxy extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static ThreadLocal<Boolean> |
DEBUG_CONTROLLER |
static ThreadLocal<File> |
OUTPUT_PATH |
| 构造器和说明 |
|---|
ProtobufProxy() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
clearCache() |
static void |
compile(Class<?> cls,
File outputPath) |
static <T> Codec<T> |
create(Class<T> cls)
To create a protobuf proxy class for target class.
|
static <T> Codec<T> |
create(Class<T> cls,
boolean debug) |
static <T> Codec<T> |
create(Class<T> cls,
boolean debug,
File path)
To create a protobuf proxy class for target class.
|
protected static <T> Codec<T> |
doCreate(Class<T> cls,
boolean debug)
To create a protobuf proxy class for target class.
|
static void |
dynamicCodeGenerate(OutputStream os,
Class cls,
Charset charset)
To generate a protobuf proxy java source code for target class.
|
public static final ThreadLocal<Boolean> DEBUG_CONTROLLER
public static final ThreadLocal<File> OUTPUT_PATH
public static void dynamicCodeGenerate(OutputStream os, Class cls, Charset charset) throws IOException
os - to generate java source codecls - target classcharset - charset typeIOException - in case of any io relative exception.public static <T> Codec<T> create(Class<T> cls)
T - generic typecls - target class to parse @Protobuf annotationCodec instance proxypublic static void compile(Class<?> cls, File outputPath)
cls - target class to be compiledoutputPath - compile byte files output streampublic static <T> Codec<T> create(Class<T> cls, boolean debug, File path)
T - target object type to be proxied.cls - target object classdebug - true will print generate java source codeprotected static <T> Codec<T> doCreate(Class<T> cls, boolean debug)
T - target object type to be proxied.cls - target object classdebug - true will print generate java source codepublic static void clearCache()
Copyright © 2016 Baidu, Inc.. All rights reserved.