Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
77a2494
Refactoring code to not use one big class for creation of builderDto …
AndreasIgel Dec 31, 2025
17294e6
Splitting ConsumerMethodGenerator into multiple Generators
AndreasIgel Dec 31, 2025
f81f599
Refactoring code of Generators for separtion of concepts, using TypeN…
AndreasIgel Jan 1, 2026
bb36013
Reactoring to use service registry for build-in generators too
AndreasIgel Jan 1, 2026
ab207e0
Adding a helper function in ProcessingContext to support warning with…
AndreasIgel Jan 1, 2026
d758f9c
Adding an extension point for Enhancing generated builders
AndreasIgel Jan 1, 2026
02d3d76
Moving creation of with-interface to Enhancer
AndreasIgel Jan 1, 2026
44374e3
Moving logic on BuilderClass from JavaCodeGenerator to Enhancers
AndreasIgel Jan 1, 2026
589a2b6
Adding helper function for full qualified names in Types and replacin…
AndreasIgel Jan 1, 2026
5b2edf1
Fixing Support of generics in DTOs
AndreasIgel Jan 1, 2026
e252e60
fixing code of generic typed fields
AndreasIgel Jan 2, 2026
4ab33e6
Fixing Jackson-Annotation (without prefix the attribute "withPrefix" …
AndreasIgel Jan 2, 2026
d82ce4b
Adapting full generated texts with changes of ordering and extended j…
AndreasIgel Jan 2, 2026
e446bf9
Swapping empty constructor with constructor by instance in ordering i…
AndreasIgel Jan 2, 2026
1b58221
Extending generated javadoc in generated Builders
AndreasIgel Jan 2, 2026
f029d25
Revert "Extending generated javadoc in generated Builders"
AndreasIgel Jan 2, 2026
8a9bae9
Removing example usage from Builders-JavaDoc (as long as we do not ha…
AndreasIgel Jan 2, 2026
8b1d8d3
Adding documentation to Generators and Enhancers regarding the genera…
AndreasIgel Jan 2, 2026
4d7b60c
Fixing code smells in branch
AndreasIgel Jan 2, 2026
77ce323
Code style: reducing parameter names in createFieldSetterWithTransform
AndreasIgel Jan 2, 2026
53fca5f
Refactoring setBuilderAndConstructorInfo to reduce complexity
AndreasIgel Jan 2, 2026
85a7c09
Revert "Code style: reducing parameter names in createFieldSetterWith…
AndreasIgel Jan 2, 2026
5091464
Extracting duplicated code into MethodGeneratorUtil
AndreasIgel Jan 2, 2026
6488656
Fixing codestyle issues
AndreasIgel Jan 2, 2026
d726a7c
Moving creation of Consumer-TypeNameGeneric into MethodGeneratorUtil
AndreasIgel Jan 2, 2026
89e1779
Adding functionality to filter components for builder-generation
AndreasIgel Jan 2, 2026
a1c36c4
Extending documentation for configuration and customizing
AndreasIgel Jan 2, 2026
b7cf8f1
Splitting CollectionHelperGenerator into 3 different generators
AndreasIgel Jan 2, 2026
9fe2c53
Fixing codesmells
AndreasIgel Jan 2, 2026
9869da0
Changing documentation of string-format helpers
AndreasIgel Jan 18, 2026
e2e2a4f
Improving code to be better readable
AndreasIgel Jan 18, 2026
f809050
Using code-marker in JavaDoc for not having &lt or &gt there
AndreasIgel Jan 18, 2026
cd75afa
Using collectionUtils instead of innerTypes.isEmpty
AndreasIgel Jan 18, 2026
f1b1a0d
Update StringFormatHelperGenerator.java
AndreasIgel Jan 18, 2026
e0a073e
Replacing generated Javadoc for withinterface
AndreasIgel Jan 18, 2026
218bd1f
Fixing codeformat
AndreasIgel Jan 18, 2026
5e6530f
Fixing documentation of CustomValidationGenerator in CUSTOMIZING.md
AndreasIgel Jan 18, 2026
35f0d0b
Adding additional constructor with 2 parameters for MethodDto
AndreasIgel Jan 18, 2026
1861a77
Creating test for code in customizing.md
AndreasIgel Jan 18, 2026
1a52d57
Adding links on classes for code generation in markdown
AndreasIgel Feb 21, 2026
3e24772
Moving the two different service-files into one
AndreasIgel Feb 21, 2026
7920077
Adding links on classes for code generation in markdown
AndreasIgel Feb 21, 2026
c55698b
Fixing builds for processor
AndreasIgel Feb 21, 2026
6015f20
Fixing debug logging
AndreasIgel Feb 21, 2026
76068e2
Optimization of coding structure
AndreasIgel Feb 21, 2026
fe59748
Adding missing JavaDoc
AndreasIgel Feb 21, 2026
8d0d889
Improving code base
AndreasIgel Feb 21, 2026
8a21737
Improving code quality by removing unneeded optionals
AndreasIgel Feb 21, 2026
f679808
Improving code quality in JavaLangMapper by separating
AndreasIgel Feb 21, 2026
732188e
Improving codeQuality in JavaLangMapper by reusing code
AndreasIgel Feb 21, 2026
d14f151
Improving logging of methodDto
AndreasIgel Feb 21, 2026
d982796
Adding extensionpoints, so switching from private to protectd helper …
AndreasIgel Feb 21, 2026
beb7db2
Improving FieldConsumerGenerator code by moving functions in helpers …
AndreasIgel Feb 21, 2026
7413be5
Improving codequality
AndreasIgel Feb 21, 2026
c8a6bc0
Replacing usage of static strings for replacement vars by direct usag…
AndreasIgel Feb 21, 2026
48191b3
Improving documentation
AndreasIgel Feb 22, 2026
6687452
Removing unused method parameter
AndreasIgel Feb 22, 2026
fd781ab
Adding tests for code snippets and updating CUSTOMIZING.md
AndreasIgel Feb 22, 2026
fb93145
Catching exception on generation of Method
AndreasIgel Feb 23, 2026
2784ba2
Improving code readability according to feedback
AndreasIgel Feb 28, 2026
38c9e87
Adding further tests to increase coverage of new generators
AndreasIgel Feb 28, 2026
ee8d96c
Removing ineffective tests
AndreasIgel Feb 28, 2026
d43fa07
Improving code for readability
AndreasIgel Feb 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@
OptionState generateAddToCollectionHelpers() default OptionState.UNSET;

/**
* Generate unboxed optional methods that accept the inner type T directly instead of
* Optional&lt;T&gt;. <br>
* Generate unboxed optional methods that accept the inner type T directly instead of {@code
* Optional<T>}. <br>
* For Optional fields, this generates a setter that accepts T and wraps it with
* Optional.ofNullable().
*
Expand Down Expand Up @@ -495,7 +495,7 @@
* <p>Example:
*
* <pre>{@code
* @Generated("org.javahelpers.simple.builders.processor.BuilderProcessor")
* @Generated("Generated by org.javahelpers.simple.builders.processor.BuilderProcessor")
* public class PersonDtoBuilder {
* // ...
* }
Expand Down Expand Up @@ -542,6 +542,8 @@
*
* Default: ENABLED <br>
* Compiler option: -Asimplebuilder.implementsBuilderBase
*
* @return the option state for implementing BuilderBase interface
*/
OptionState implementsBuilderBase() default OptionState.UNSET;

Expand All @@ -565,6 +567,8 @@
*
* Default: ENABLED <br>
* Compiler option: -Asimplebuilder.generateWithInterface
*
* @return the option state for generating With interface
*/
OptionState generateWithInterface() default OptionState.UNSET;

Expand All @@ -586,6 +590,8 @@
*
* Default: DISABLED <br>
* Compiler option: -Asimplebuilder.usingJacksonDeserializerAnnotation
*
* @return the option state for using Jackson deserializer annotation
*/
OptionState usingJacksonDeserializerAnnotation() default OptionState.UNSET;

Expand All @@ -600,6 +606,8 @@
*
* <p>Default: DISABLED <br>
* Compiler option: -Asimplebuilder.generateJacksonModule
*
* @return the option state for generating Jackson module
*/
OptionState generateJacksonModule() default OptionState.UNSET;

Expand All @@ -614,6 +622,8 @@
*
* <p>Default: "" (empty - generate one module per package) <br>
* Compiler option: -Asimplebuilder.jacksonModulePackage
*
* @return the package name for the Jackson module
*/
String jacksonModulePackage() default "";

Expand All @@ -635,6 +645,8 @@
*
* Default: "Builder" <br>
* Compiler option: -Asimplebuilder.builderSuffix
*
* @return the suffix for the builder class name
*/
String builderSuffix() default "Builder";

Expand All @@ -661,6 +673,8 @@
*
* Default: "" (empty - no suffix) <br>
* Compiler option: -Asimplebuilder.setterSuffix
*
* @return the suffix for setter method names
*/
String setterSuffix() default "";
}
Expand Down
53 changes: 46 additions & 7 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Simple-builders supports fine-grained configuration through the `@SimpleBuilder.
- [Conditional Logic](#conditional-logic)
- [Access Control](#access-control)
- [Collection Helpers](#collection-helpers)
- [Component Filtering](#component-filtering)
- [Integration](#integration)
- [Examples](#examples)
- [Minimal Builder](#minimal-builder)
Expand Down Expand Up @@ -390,19 +391,26 @@ PersonDto person = PersonDtoBuilder.create()

**Default**: `ENABLED` | **Compiler Option**: `-Asimplebuilder.generateStringFormatHelpers=ENABLED|DISABLED`

Generates `String.format()` helper methods for String fields.
Generates `String.format()` helper methods for String and Optional<String> fields.

**When ENABLED**:
```java
// Generated method
public PersonDtoBuilder name(String format, Object... args) {
this.name = changedValue(String.format(format, args));
return this;
// For String title field:
public BookDtoBuilder title(String format, Object... args) {
this.title = changedValue(String.format(format, args));
return this;
}

// For Optional<String> subtitle field:
public BookDtoBuilder subtitle(String format, Object... args) {
this.subtitle = changedValue(Optional.of(String.format(format, args)));
return this;
}

// Usage
PersonDto person = PersonDtoBuilder.create()
.name("Hello, %s %s!", firstName, lastName)
BookDto book = BookDtoBuilder.create()
.title("The %s Guide", "Complete")
.subtitle("A comprehensive %s tutorial for %s", "Java", "beginners")
.build();
```

Expand Down Expand Up @@ -599,6 +607,34 @@ Generates methods using `HashMapBuilder` for fluent Map construction.

---

### Component Filtering

#### `deactivateGenerationComponents`

**Default**: `""` (empty) | **Compiler Option**: `-Asimplebuilder.deactivateGenerationComponents=pattern1,pattern2,...`

Deactivates specific method generators and builder enhancers by class name pattern. This allows you to override default generators/enhancers with your own custom implementations.

**Primary Use Case**: Override Default Components

When you want to replace a built-in generator or enhancer with your own custom implementation, you first deactivate the default component, then register your custom one via ServiceLoader.

For detailed instructions on creating custom generators and enhancers, see [**CUSTOMIZING.md**](CUSTOMIZING.md).

**Pattern Matching**:
- **Exact match**: `ConditionalEnhancer` - deactivates exactly this class
- **Wildcard suffix**: `*HelperGenerator` - deactivates all classes ending with HelperGenerator
- **Wildcard prefix**: `String*` - deactivates all classes starting with String
- **Wildcard anywhere**: `*Consumer*` - deactivates all classes containing Consumer

**Feature Toggling vs Component Override**:
- **Feature toggling**: Use `@SimpleBuilder.Options(generateConditionalHelper = DISABLED)`
- **Component override**: Use `deactivateGenerationComponents` + custom ServiceLoader implementation

See [**CUSTOMIZING.md**](CUSTOMIZING.md) for complete implementation examples and best practices.

---

### Integration & Annotations

#### `generateWithInterface`
Expand Down Expand Up @@ -1183,6 +1219,9 @@ methodAccess = AccessModifier.PRIVATE
-Asimplebuilder.usingHashSetBuilderWithElementBuilders=ENABLED|DISABLED
-Asimplebuilder.usingHashMapBuilder=ENABLED|DISABLED

# Component Filtering
-Asimplebuilder.deactivateGenerationComponents=pattern1,pattern2,...

# Integration & Annotations
-Asimplebuilder.generateWithInterface=ENABLED|DISABLED
-Asimplebuilder.implementsBuilderBase=ENABLED|DISABLED
Expand Down
Loading
Loading