Package org.derive4j.processor
Class DerivingProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.derive4j.processor.DerivingProcessor
- All Implemented Interfaces:
Processor
@AutoService(javax.annotation.processing.Processor.class)
@SupportedAnnotationTypes("*")
public final class DerivingProcessor
extends AbstractProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AdtParser
private Derivator
private DeriveConfigBuilder
private DeriveUtilsImpl
private final ArrayList
<P2<String, RuntimeException>> private static final Set
<ElementKind> Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionderivation
(TypeElement element, DeriveConfig deriveConfig) private Map
<com.squareup.javapoet.ClassName, P2<Stream<DeriveMessage>, DerivedCodeSpec>> findAllElements
(Stream<? extends Element> elements) void
init
(ProcessingEnvironment processingEnv) loadDerivators
(DeriveUtils deriveUtils) loadEextensions
(DeriveUtils deriveUtils) private Function
<DeriveMessage, IO<Unit>> mesagePrint
(TypeElement element) private void
printErrorMessage
(String typeElement, Throwable error) boolean
process
(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) private static String
private com.squareup.javapoet.TypeSpec.Builder
toTypeSpec
(DeriveConfig deriveConfig, com.squareup.javapoet.ClassName targetClassName, DerivedCodeSpec codeSpec) Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, isInitialized
-
Field Details
-
scannedElementKinds
-
remainingElements
-
deriveUtils
-
builtinDerivator
-
adtParser
-
deriveConfigBuilder
-
extensions
-
derivators
-
-
Constructor Details
-
DerivingProcessor
public DerivingProcessor()
-
-
Method Details
-
getSupportedSourceVersion
- Specified by:
getSupportedSourceVersion
in interfaceProcessor
- Overrides:
getSupportedSourceVersion
in classAbstractProcessor
-
init
- Specified by:
init
in interfaceProcessor
- Overrides:
init
in classAbstractProcessor
-
process
- Specified by:
process
in interfaceProcessor
- Specified by:
process
in classAbstractProcessor
-
derivation
-
mesagePrint
-
toTypeSpec
private com.squareup.javapoet.TypeSpec.Builder toTypeSpec(DeriveConfig deriveConfig, com.squareup.javapoet.ClassName targetClassName, DerivedCodeSpec codeSpec) -
derivedInstances
private Map<com.squareup.javapoet.ClassName,P2<Stream<DeriveMessage>, derivedInstancesDerivedCodeSpec>> (AlgebraicDataType adt) -
printErrorMessage
-
loadEextensions
-
loadDerivators
-
findAllElements
-
showStackTrace
-