类 CodecProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
cn.wjybxx.apt.MyAbstractProcessor
cn.wjybxx.dson.codec.CodecProcessor
- 所有已实现的接口:
Processor
@AutoService(javax.annotation.processing.Processor.class)
public class CodecProcessor
extends cn.wjybxx.apt.MyAbstractProcessor
- 作者:
- wjybxx date 2023/4/13
-
字段概要
字段修饰符和类型字段说明com.squareup.javapoet.AnnotationSpecstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringcom.squareup.javapoet.AnnotationSpecstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringcom.squareup.javapoet.ClassNamecom.squareup.javapoet.ClassNamecom.squareup.javapoet.ClassNamecom.squareup.javapoet.ClassNamecom.squareup.javapoet.ClassName从类继承的字段 cn.wjybxx.apt.MyAbstractProcessor
elementUtils, filer, messager, processorInfoAnnotation, typeUtils从类继承的字段 javax.annotation.processing.AbstractProcessor
processingEnv -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleancanGetDirectly(VariableElement variableElement, TypeElement typeElement) 测试TypeElement是否可以直接读取字段。booleancanSetDirectly(VariableElement variableElement, TypeElement typeElement) 测试TypeElement是否可以直接写字段。booleancontainsReaderConstructor(TypeElement typeElement, TypeMirror readerTypeMirror) 是否包含 T(Reader reader) 构造方法booleancontainsReadObjectMethod(List<? extends Element> allFieldsAndMethodWithInherit, TypeMirror readerTypeMirror) 是否包含 readerObject 实例方法booleancontainsWriteObjectMethod(List<? extends Element> allFieldsAndMethodWithInherit, TypeMirror writerTypeMirror) 是否包含 writeObject 实例方法protected booleandoProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) protected voidfindAfterDecodeMethod(List<? extends Element> allFieldsAndMethodWithInherit) 查找反序列化钩子方法findNotPrivateGetter(VariableElement variableElement, List<? extends Element> allFieldsAndMethodWithInherit) 查找非private的getter方法findNotPrivateSetter(VariableElement variableElement, List<? extends Element> allFieldsAndMethodWithInherit) 查找非private的setter方法protected booleanisByteArray(TypeMirror typeMirror) protected booleanisClassOrEnum(TypeElement typeElement) protected booleanisCollection(TypeMirror typeMirror) protected booleanisEnumLite(TypeMirror typeMirror) protected booleanisEnumMap(TypeMirror typeMirror) protected booleanisEnumSet(TypeMirror typeMirror) protected booleanisMap(TypeMirror typeMirror) booleanisSerializableField(VariableElement variableElement, TypeMirror ignoreTypeMirror) 是否是可序列化的字段protected booleanisSet(TypeMirror typeMirror) protected booleanisString(TypeMirror typeMirror) com.squareup.javapoet.MethodSpec.BuildernewAfterDecodeMethodBuilder(DeclaredType superDeclaredType, TypeMirror readerTypeMirror) com.squareup.javapoet.MethodSpecnewGetEncoderClassMethod(DeclaredType superDeclaredType, com.squareup.javapoet.TypeName rawTypeName) com.squareup.javapoet.MethodSpec.BuildernewNewInstanceMethodBuilder(DeclaredType superDeclaredType, TypeMirror readerTypeMirror) com.squareup.javapoet.MethodSpec.BuildernewReadFieldsMethodBuilder(DeclaredType superDeclaredType, TypeMirror readerTypeMirror) com.squareup.javapoet.MethodSpec.BuildernewWriteObjectMethodBuilder(DeclaredType superDeclaredType, TypeMirror writerTypeMirror) 从类继承的方法 cn.wjybxx.apt.MyAbstractProcessor
getSupportedSourceVersion, init, process从类继承的方法 javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedOptions, isInitialized
-
字段详细资料
-
CNAME_FIELD_IMPL
- 另请参阅:
-
CNAME_CLASS_IMPL
- 另请参阅:
-
CNAME_TYPEARG
- 另请参阅:
-
CNAME_WireType
- 另请参阅:
-
CNAME_NumberStyle
- 另请参阅:
-
CNAME_StringStyle
- 另请参阅:
-
CNAME_ObjectStyle
- 另请参阅:
-
CNAME_DOC_SERIALIZABLE
- 另请参阅:
-
CNAME_DOC_IGNORE
- 另请参阅:
-
CNAME_BIN_SERIALIZABLE
- 另请参阅:
-
CNAME_BIN_IGNORE
- 另请参阅:
-
CNAME_POJO_CODEC
- 另请参阅:
-
MNAME_READ_OBJECT
- 另请参阅:
-
MNAME_WRITE_OBJECT
- 另请参阅:
-
MNAME_GET_ENCODER_CLASS
- 另请参阅:
-
MNAME_NEW_INSTANCE
- 另请参阅:
-
MNAME_READ_FIELDS
- 另请参阅:
-
MNAME_AFTER_DECODE
- 另请参阅:
-
CNAME_ENUM_LITE
- 另请参阅:
-
MNAME_FOR_NUMBER
- 另请参阅:
-
MNAME_GET_NUMBER
- 另请参阅:
-
anno_fieldImplTypeMirror
-
anno_classImplTypeMirror
-
typeNameTypeArgInfo
public com.squareup.javapoet.ClassName typeNameTypeArgInfo -
typeNameWireType
public com.squareup.javapoet.ClassName typeNameWireType -
typeNameNumberStyle
public com.squareup.javapoet.ClassName typeNameNumberStyle -
typeNameStringStyle
public com.squareup.javapoet.ClassName typeNameStringStyle -
typeNameObjectStyle
public com.squareup.javapoet.ClassName typeNameObjectStyle -
anno_docSerializable
-
anno_docIgnore
-
docReaderTypeMirror
-
docWriterTypeMirror
-
docScanIgnoreAnnoSpec
public com.squareup.javapoet.AnnotationSpec docScanIgnoreAnnoSpec -
anno_binSerializable
-
anno_binIgnore
-
binReaderTypeMirror
-
binWriterTypeMirror
-
binScanIgnoreAnnoSpec
public com.squareup.javapoet.AnnotationSpec binScanIgnoreAnnoSpec -
anno_codecLinkerGroup
-
anno_codecLinker
-
abstractCodecTypeElement
-
getEncoderClassMethod
-
doc_newInstanceMethod
-
doc_readFieldsMethod
-
doc_afterDecodeMethod
-
doc_writeObjectMethod
-
bin_newInstanceMethod
-
bin_readFieldsMethod
-
bin_afterDecodeMethod
-
bin_writeObjectMethod
-
enumCodecTypeElement
-
stringTypeMirror
-
enumLiteTypeMirror
-
mapTypeMirror
-
collectionTypeMirror
-
setTypeMirror
-
enumSetRawTypeMirror
-
enumMapRawTypeMirror
-
linkedHashMapTypeMirror
-
linkedHashSetTypeMirror
-
arrayListTypeMirror
-
-
构造器详细资料
-
CodecProcessor
public CodecProcessor()
-
-
方法详细资料
-
getSupportedAnnotationTypes
- 指定者:
getSupportedAnnotationTypes在接口中Processor- 指定者:
getSupportedAnnotationTypes在类中cn.wjybxx.apt.MyAbstractProcessor
-
ensureInited
protected void ensureInited()- 指定者:
ensureInited在类中cn.wjybxx.apt.MyAbstractProcessor
-
doProcess
- 指定者:
doProcess在类中cn.wjybxx.apt.MyAbstractProcessor
-
containsReaderConstructor
是否包含 T(Reader reader) 构造方法 -
containsReadObjectMethod
public boolean containsReadObjectMethod(List<? extends Element> allFieldsAndMethodWithInherit, TypeMirror readerTypeMirror) 是否包含 readerObject 实例方法 -
containsWriteObjectMethod
public boolean containsWriteObjectMethod(List<? extends Element> allFieldsAndMethodWithInherit, TypeMirror writerTypeMirror) 是否包含 writeObject 实例方法 -
findAfterDecodeMethod
public ExecutableElement findAfterDecodeMethod(List<? extends Element> allFieldsAndMethodWithInherit) 查找反序列化钩子方法 -
canGetDirectly
测试TypeElement是否可以直接读取字段。 (这里需要考虑继承问题)- 参数:
variableElement- 类字段,可能是继承的字段- 返回:
- 如果可直接取值,则返回true
-
canSetDirectly
测试TypeElement是否可以直接写字段。 (这里需要考虑继承问题)- 参数:
variableElement- 类字段,可能是继承的字段- 返回:
- 如果可直接赋值,则返回true
-
findNotPrivateGetter
public ExecutableElement findNotPrivateGetter(VariableElement variableElement, List<? extends Element> allFieldsAndMethodWithInherit) 查找非private的getter方法- 参数:
allFieldsAndMethodWithInherit- 所有的字段和方法,可能在父类中
-
findNotPrivateSetter
public ExecutableElement findNotPrivateSetter(VariableElement variableElement, List<? extends Element> allFieldsAndMethodWithInherit) 查找非private的setter方法- 参数:
allFieldsAndMethodWithInherit- 所有的字段和方法,可能在父类中
-
isSerializableField
是否是可序列化的字段 -
isClassOrEnum
-
isString
-
isByteArray
-
isEnumLite
-
isMap
-
isCollection
-
isSet
-
isEnumSet
-
isEnumMap
-
newGetEncoderClassMethod
public com.squareup.javapoet.MethodSpec newGetEncoderClassMethod(DeclaredType superDeclaredType, com.squareup.javapoet.TypeName rawTypeName) -
newNewInstanceMethodBuilder
public com.squareup.javapoet.MethodSpec.Builder newNewInstanceMethodBuilder(DeclaredType superDeclaredType, TypeMirror readerTypeMirror) -
newReadFieldsMethodBuilder
public com.squareup.javapoet.MethodSpec.Builder newReadFieldsMethodBuilder(DeclaredType superDeclaredType, TypeMirror readerTypeMirror) -
newAfterDecodeMethodBuilder
public com.squareup.javapoet.MethodSpec.Builder newAfterDecodeMethodBuilder(DeclaredType superDeclaredType, TypeMirror readerTypeMirror) -
newWriteObjectMethodBuilder
public com.squareup.javapoet.MethodSpec.Builder newWriteObjectMethodBuilder(DeclaredType superDeclaredType, TypeMirror writerTypeMirror)
-