Summary
@SimpleBuilder is not meta-annotated with java.lang.annotation.Inherited, and BuilderProcessor collects types via RoundEnvironment.getElementsAnnotatedWith(...), which only returns inherited annotations when the annotation type itself is @Inherited.
I verified this with temporary sanity tests:
- A parent with plain
@SimpleBuilder and an unannotated child class does not produce a builder for the child. - A custom annotation meta-annotated with
@SimpleBuilder.Template and @Inherited, placed on a parent, does produce a builder for an unannotated child.
So in practice only @SimpleBuilder.Template (via custom annotations that themselves are @Inherited) is inherited, not the plain @SimpleBuilder annotation.
Places that currently imply @SimpleBuilder is inherited
core/src/main/java/org/javahelpers/simple/builders/core/annotations/SimpleBuilder.java class-level Javadoc: "when an inherited @SimpleBuilder or @SimpleBuilder.Template would otherwise trigger it"docs/CONFIGURATION.md (## Excluding Types from Builder Generation): "when a class inherits @SimpleBuilder or an @SimpleBuilder.Template annotation from a parent" and "even if ParentDto carries @SimpleBuilder or an @Inherited template annotation"Ignore4BuilderGeneration.java Javadoc: "even if @SimpleBuilder or @SimpleBuilder.Template annotation is inherited from a parent type"
Suggested fix
SimpleBuilder should get inherited too and the documentation should be checked and possibly updated regarding inheritance.
Summary
@SimpleBuilderis not meta-annotated withjava.lang.annotation.Inherited, andBuilderProcessorcollects types viaRoundEnvironment.getElementsAnnotatedWith(...), which only returns inherited annotations when the annotation type itself is@Inherited.I verified this with temporary sanity tests:
@SimpleBuilderand an unannotated child class does not produce a builder for the child.@SimpleBuilder.Templateand@Inherited, placed on a parent, does produce a builder for an unannotated child.So in practice only
@SimpleBuilder.Template(via custom annotations that themselves are@Inherited) is inherited, not the plain@SimpleBuilderannotation.Places that currently imply
@SimpleBuilderis inheritedcore/src/main/java/org/javahelpers/simple/builders/core/annotations/SimpleBuilder.javaclass-level Javadoc: "when an inherited@SimpleBuilderor@SimpleBuilder.Templatewould otherwise trigger it"docs/CONFIGURATION.md(## Excluding Types from Builder Generation): "when a class inherits@SimpleBuilderor an@SimpleBuilder.Templateannotation from a parent" and "even if ParentDto carries@SimpleBuilderor an@Inheritedtemplate annotation"Ignore4BuilderGeneration.javaJavadoc: "even if@SimpleBuilderor@SimpleBuilder.Templateannotation is inherited from a parent type"Suggested fix
SimpleBuilder should get inherited too and the documentation should be checked and possibly updated regarding inheritance.