类 CodecProcessor

java.lang.Object
javax.annotation.processing.AbstractProcessor
cn.wjybxx.apt.MyAbstractProcessor
cn.wjybxx.dson.apt.CodecProcessor
所有已实现的接口:
Processor

@AutoService(javax.annotation.processing.Processor.class) public class CodecProcessor extends cn.wjybxx.apt.MyAbstractProcessor
作者:
wjybxx date 2023/4/13
  • 字段详细资料

    • CNAME_TypeArg

      public static final String CNAME_TypeArg
      另请参阅:
    • CNAME_WireType

      public static final String CNAME_WireType
      另请参阅:
    • CNAME_NumberStyle

      public static final String CNAME_NumberStyle
      另请参阅:
    • CNAME_StringStyle

      public static final String CNAME_StringStyle
      另请参阅:
    • CNAME_ObjectStyle

      public static final String CNAME_ObjectStyle
      另请参阅:
    • CNAME_FIELD_IMPL

      public static final String CNAME_FIELD_IMPL
      另请参阅:
    • CNAME_CLASS_IMPL

      public static final String CNAME_CLASS_IMPL
      另请参阅:
    • CNAME_CODEC

      public static final String CNAME_CODEC
      另请参阅:
    • MNAME_READ_OBJECT

      public static final String MNAME_READ_OBJECT
      另请参阅:
    • MNAME_WRITE_OBJECT

      public static final String MNAME_WRITE_OBJECT
      另请参阅:
    • MNAME_GET_ENCODER_CLASS

      public static final String MNAME_GET_ENCODER_CLASS
      另请参阅:
    • MNAME_NEW_INSTANCE

      public static final String MNAME_NEW_INSTANCE
      另请参阅:
    • MNAME_READ_FIELDS

      public static final String MNAME_READ_FIELDS
      另请参阅:
    • MNAME_AFTER_DECODE

      public static final String MNAME_AFTER_DECODE
      另请参阅:
    • CNAME_ENUM_LITE

      public static final String CNAME_ENUM_LITE
      另请参阅:
    • MNAME_FOR_NUMBER

      public static final String MNAME_FOR_NUMBER
      另请参阅:
    • MNAME_GET_NUMBER

      public static final String MNAME_GET_NUMBER
      另请参阅:
    • anno_fieldImplTypeMirror

      public TypeMirror anno_fieldImplTypeMirror
    • anno_classImplTypeMirror

      public TypeMirror 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_dsonSerializable

      public TypeElement anno_dsonSerializable
    • anno_dsonIgnore

      public TypeMirror anno_dsonIgnore
    • dsonReaderTypeMirror

      public TypeMirror dsonReaderTypeMirror
    • dsonWriterTypeMirror

      public TypeMirror dsonWriterTypeMirror
    • dsonScanIgnoreAnnoSpec

      public com.squareup.javapoet.AnnotationSpec dsonScanIgnoreAnnoSpec
    • anno_liteSerializable

      public TypeElement anno_liteSerializable
    • anno_liteIgnore

      public TypeMirror anno_liteIgnore
    • liteReaderTypeMirror

      public TypeMirror liteReaderTypeMirror
    • liteWriterTypeMirror

      public TypeMirror liteWriterTypeMirror
    • liteScanIgnoreAnnoSpec

      public com.squareup.javapoet.AnnotationSpec liteScanIgnoreAnnoSpec
    • anno_codecLinkerGroup

      public TypeElement anno_codecLinkerGroup
    • anno_codecLinker

      public TypeElement anno_codecLinker
    • anno_codecLinkerBean

      public TypeElement anno_codecLinkerBean
    • abstractCodecTypeElement

      public TypeElement abstractCodecTypeElement
    • getEncoderClassMethod

      public ExecutableElement getEncoderClassMethod
    • dson_newInstanceMethod

      public ExecutableElement dson_newInstanceMethod
    • dson_readFieldsMethod

      public ExecutableElement dson_readFieldsMethod
    • dson_afterDecodeMethod

      public ExecutableElement dson_afterDecodeMethod
    • dson_writeObjectMethod

      public ExecutableElement dson_writeObjectMethod
    • lite_newInstanceMethod

      public ExecutableElement lite_newInstanceMethod
    • lite_readFieldsMethod

      public ExecutableElement lite_readFieldsMethod
    • lite_afterDecodeMethod

      public ExecutableElement lite_afterDecodeMethod
    • lite_writeObjectMethod

      public ExecutableElement lite_writeObjectMethod
    • enumCodecTypeElement

      public TypeElement enumCodecTypeElement
    • stringTypeMirror

      public TypeMirror stringTypeMirror
    • enumLiteTypeMirror

      public TypeMirror enumLiteTypeMirror
    • mapTypeMirror

      public TypeMirror mapTypeMirror
    • collectionTypeMirror

      public TypeMirror collectionTypeMirror
    • setTypeMirror

      public TypeMirror setTypeMirror
    • enumSetRawTypeMirror

      public TypeMirror enumSetRawTypeMirror
    • enumMapRawTypeMirror

      public TypeMirror enumMapRawTypeMirror
    • linkedHashMapTypeMirror

      public TypeMirror linkedHashMapTypeMirror
    • linkedHashSetTypeMirror

      public TypeMirror linkedHashSetTypeMirror
    • arrayListTypeMirror

      public TypeMirror arrayListTypeMirror
  • 构造器详细资料

    • CodecProcessor

      public CodecProcessor()
  • 方法详细资料

    • getSupportedAnnotationTypes

      public Set<String> getSupportedAnnotationTypes()
      指定者:
      getSupportedAnnotationTypes 在接口中 Processor
      指定者:
      getSupportedAnnotationTypes 在类中 cn.wjybxx.apt.MyAbstractProcessor
    • ensureInited

      protected void ensureInited()
      指定者:
      ensureInited 在类中 cn.wjybxx.apt.MyAbstractProcessor
    • doProcess

      protected boolean doProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
      指定者:
      doProcess 在类中 cn.wjybxx.apt.MyAbstractProcessor
    • containsReaderConstructor

      public boolean containsReaderConstructor(TypeElement typeElement, TypeMirror readerTypeMirror)
      是否包含 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

      public boolean canGetDirectly(VariableElement variableElement, TypeElement typeElement)
      测试TypeElement是否可以直接读取字段。 (这里需要考虑继承问题)
      参数:
      variableElement - 类字段,可能是继承的字段
      返回:
      如果可直接取值,则返回true
    • canSetDirectly

      public boolean canSetDirectly(VariableElement variableElement, TypeElement typeElement)
      测试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 - 所有的字段和方法,可能在父类中
    • isClassOrEnum

      protected boolean isClassOrEnum(TypeElement typeElement)
    • isString

      protected boolean isString(TypeMirror typeMirror)
    • isByteArray

      protected boolean isByteArray(TypeMirror typeMirror)
    • isEnumLite

      protected boolean isEnumLite(TypeMirror typeMirror)
    • isMap

      protected boolean isMap(TypeMirror typeMirror)
    • isCollection

      protected boolean isCollection(TypeMirror typeMirror)
    • isSet

      protected boolean isSet(TypeMirror typeMirror)
    • isEnumSet

      protected boolean isEnumSet(TypeMirror typeMirror)
    • isEnumMap

      protected boolean isEnumMap(TypeMirror typeMirror)
    • 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)