public class TypeHelper extends java.lang.Object implements ThriftConstants
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.ThreadLocal<com.google.common.base.Predicate<java.lang.reflect.Type>> |
VERIFYTYPE_MONITOR
用于外部监控所有的类型
|
COMMON_TYPES_OPTION_DESC, COMMON_TYPES_OPTION_LONG, CONFIG_OPTION, CONFIG_OPTION_DESC, CONFIG_OPTION_LONG, CXX_HELPER, DIR_PERSERVICE, DIR_PERSTRUCT, DIR_SCHEMA, ERPC_BINARY_OUTPUT_SIZE_OPTION_DESC, ERPC_BINARY_OUTPUT_SIZE_OPTION_LONG, ERPC_DEFAULT_MAX_LENGTH_OPTION_DESC, ERPC_DEFAULT_MAX_LENGTH_OPTION_LONG, ERPC_ERRMSG_MAX_LENGTH_OPTION_DESC, ERPC_ERRMSG_MAX_LENGTH_OPTION_LONG, ERPC_FORWARD_PORT_OPTION_DESC, ERPC_FORWARD_PORT_OPTION_LONG, ERPC_PORT_PREFIX_OPTION_DESC, ERPC_PORT_PREFIX_OPTION_LONG, ERPC_PROGRAM_OPTION_DESC, ERPC_PROGRAM_OPTION_LONG, ERPC_PROXY_PORT_OPTION_DESC, ERPC_PROXY_PORT_OPTION_LONG, EXTENSIVE_STRUCT_OPTION_DESC, EXTENSIVE_STRUCT_OPTION_LONG, LANGUAGE_OPTION, LANGUAGE_OPTION_DESC, LANGUAGE_OPTION_LONG, SCHEMA_INFO, TAGS_OPTION_DESC, TAGS_OPTION_LONG, TASK_TYPE_OPTION, TASK_TYPE_OPTION_DESC, TASK_TYPE_OPTION_LONG, THRIFT_CLIENT_PKG_OPTION_DESC, THRIFT_CLIENT_PKG_OPTION_LONG, THRIFT_SERVICE_CLASS_OPTION_DESC, THRIFT_SERVICE_CLASS_OPTION_LONGBASE_CLASS_OPTION, BASE_CLASS_OPTION_DESC, BASE_CLASS_OPTION_LONG, CLASS_PATH_OPTION, CLASS_PATH_OPTION_DESC, CLASS_PATH_OPTION_LONG, EXCLUDE_FIELDS_OPTION_DESC, EXCLUDE_FIELDS_OPTION_LONG, EXCLUDE_METHODS_OPTION_DESC, EXCLUDE_METHODS_OPTION_LONG, EXCLUDE_VMS_OPTION, EXCLUDE_VMS_OPTION_DESC, EXCLUDE_VMS_OPTION_LONG, INCLUDE_FIELDS_OPTION_DESC, INCLUDE_FIELDS_OPTION_LONG, INCLUDE_METHODS_OPTION_DESC, INCLUDE_METHODS_OPTION_LONG, INCLUDE_VMS_OPTION, INCLUDE_VMS_OPTION_DESC, INCLUDE_VMS_OPTION_LONG, INDEPENDENT_SEHEMA_OPTION, INDEPENDENT_SEHEMA_OPTION_DESC, INDEPENDENT_SEHEMA_OPTION_LONG, INTERFACE_CLASS_OPTION, INTERFACE_CLASS_OPTION_DESC, INTERFACE_CLASS_OPTION_LONG, REFERENCE_CLASS_OPTION, REFERENCE_CLASS_OPTION_DESC, REFERENCE_CLASS_OPTION_LONG, SHELL_INTERFACE_OPTION, SHELL_INTERFACE_OPTION_DESC, SHELL_INTERFACE_OPTION_LONG, SOURCE_PREFIX_OPTION, SOURCE_PREFIX_OPTION_DESC, SOURCE_PREFIX_OPTION_LONG, TEMPLATE_FOLDER_OPTION, TEMPLATE_FOLDER_OPTION_DESC, TEMPLATE_FOLDER_OPTION_LONG, TEMPLATE_INCLUDE_OPTION, TEMPLATE_INCLUDE_OPTION_DESC, TEMPLATE_INCLUDE_OPTION_LONG, TEMPLATE_ROOT_OPTION, TEMPLATE_ROOT_OPTION_DESC, TEMPLATE_ROOT_OPTION_LONG, USE_COMMON_RESPONSE_OPTION_DESC, USE_COMMON_RESPONSE_OPTION_LONG| 构造器和说明 |
|---|
TypeHelper(net.gdface.codegen.AbstractSchema parent) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addReferTypes(net.gdface.codegen.Method method) |
void |
addReferTypes(java.lang.reflect.Type type) |
static void |
checkNotGeneric(java.lang.Class<?> clazz)
确保
clazz不是泛型类 |
static void |
checkNotGeneric(java.lang.reflect.Method method)
确保
method不是泛型方法 |
static void |
checkNotGeneric(net.gdface.codegen.Method method)
确保
method不是泛型方法 |
void |
checkParameter(net.gdface.codegen.Method method)
验证参数类型
|
void |
checkReturnType(net.gdface.codegen.Method method)
验证返回类型
|
void |
checkThrows(net.gdface.codegen.Method method) |
void |
checkType(net.gdface.codegen.Method method)
确保方法的参数和返回类型符合要求
|
void |
checkType(java.lang.reflect.Type type) |
java.util.List<ThriftStructDecorator> |
getDecorateTypes() |
java.util.Map<java.lang.String,java.beans.PropertyDescriptor> |
getFields(java.lang.Class<?> clazz) |
java.util.Map<java.lang.String,java.beans.PropertyDescriptor> |
getFields(java.lang.Class<?> clazz,
com.google.common.base.Predicate<java.beans.PropertyDescriptor> filter) |
java.util.Map<java.lang.String,java.beans.PropertyDescriptor> |
getFields(java.lang.Class<?> clazz,
com.google.common.base.Predicate<java.beans.PropertyDescriptor> filter,
boolean lenient) |
java.util.List<java.lang.Class<?>> |
getReferExceptions() |
java.util.List<ThriftStructDecorator> |
getThriftTypes() |
java.util.List<java.lang.Class<?>> |
getTypesWithDecorator() |
boolean |
isClientThriftType(java.lang.reflect.Type type) |
boolean |
needTransformer() |
boolean |
sameWithClientThriftType(java.lang.reflect.Type type) |
boolean |
sameWithClientThriftyType(java.lang.reflect.Type type) |
boolean |
sameWithThriftDecoratorType(java.lang.reflect.Type type) |
boolean |
sameWithThriftyDecoratorType(java.lang.reflect.Type type) |
java.lang.String |
toClientThriftType(java.lang.reflect.Type type)
将指定的类型转为thrift支持的类型
|
java.lang.String |
toClientThriftyType(java.lang.reflect.Type type)
将指定的类型转为Microsoft/thrifty支持的类型
|
java.lang.String |
toThriftDecoratorType(java.lang.reflect.Type type)
返回指定类型在thrift client对应的装饰类名
|
java.lang.String |
toThriftType(java.lang.reflect.Type type)
将指定的类型转为thrift支持的类型
|
java.lang.String |
toThriftyDecoratorType(java.lang.reflect.Type type)
返回指定类型在thrifty client对应的装饰类名,如果非decorator,则调用
toClientThriftType0(Type, boolean, boolean, boolean, Map) |
boolean |
verifyType(java.lang.reflect.Type type) |
public static final java.lang.ThreadLocal<com.google.common.base.Predicate<java.lang.reflect.Type>> VERIFYTYPE_MONITOR
public final boolean verifyType(java.lang.reflect.Type type)
public java.util.Map<java.lang.String,java.beans.PropertyDescriptor> getFields(java.lang.Class<?> clazz,
com.google.common.base.Predicate<java.beans.PropertyDescriptor> filter,
boolean lenient)
public java.util.Map<java.lang.String,java.beans.PropertyDescriptor> getFields(java.lang.Class<?> clazz,
com.google.common.base.Predicate<java.beans.PropertyDescriptor> filter)
public java.util.Map<java.lang.String,java.beans.PropertyDescriptor> getFields(java.lang.Class<?> clazz)
public java.util.List<ThriftStructDecorator> getDecorateTypes()
public java.util.List<ThriftStructDecorator> getThriftTypes()
ThriftStruct 注释的类型public java.lang.String toThriftType(java.lang.reflect.Type type)
type - public java.lang.String toClientThriftType(java.lang.reflect.Type type)
type - public java.lang.String toThriftDecoratorType(java.lang.reflect.Type type)
type - public boolean sameWithClientThriftType(java.lang.reflect.Type type)
public boolean sameWithThriftDecoratorType(java.lang.reflect.Type type)
public java.lang.String toClientThriftyType(java.lang.reflect.Type type)
type - public boolean isClientThriftType(java.lang.reflect.Type type)
public java.lang.String toThriftyDecoratorType(java.lang.reflect.Type type)
toClientThriftType0(Type, boolean, boolean, boolean, Map)type - public boolean sameWithClientThriftyType(java.lang.reflect.Type type)
public boolean sameWithThriftyDecoratorType(java.lang.reflect.Type type)
public void checkType(java.lang.reflect.Type type)
public void checkType(net.gdface.codegen.Method method)
method - public void checkParameter(net.gdface.codegen.Method method)
method - public void checkReturnType(net.gdface.codegen.Method method)
method - public void checkThrows(net.gdface.codegen.Method method)
public static void checkNotGeneric(java.lang.Class<?> clazz)
clazz不是泛型类clazz - public static void checkNotGeneric(java.lang.reflect.Method method)
method不是泛型方法method - public static void checkNotGeneric(net.gdface.codegen.Method method)
method不是泛型方法method - public void addReferTypes(java.lang.reflect.Type type)
public void addReferTypes(net.gdface.codegen.Method method)
public boolean needTransformer()
public java.util.List<java.lang.Class<?>> getTypesWithDecorator()
public java.util.List<java.lang.Class<?>> getReferExceptions()
Copyright © 2022. All Rights Reserved.