Package com.blackbuild.klum.ast.jackson
Class KlumJacksonImporter
java.lang.Object
com.blackbuild.klum.ast.jackson.KlumJacksonImporter
Explicit, Builder-first Jackson import operations.
The importer captures one untyped ObjectReader; it never mutates a mapper or registers a module. Configure
Jackson, including KlumAstModule, before creating it. Each method consumes exactly one
KlumJacksonInput; parser lifecycle remains with the caller.
-
Method Summary
Modifier and TypeMethodDescription<B extends com.blackbuild.klum.ast.runtime.KlumBuilder<?>>
BapplyToBuilder(B builder, KlumJacksonInput input) Applies one input to the same unsealed Builder in its active Construction session.<T,B extends com.blackbuild.klum.ast.runtime.KlumBuilder<T>>
BreadBuilder(com.blackbuild.klum.ast.runtime.KlumFactory.BuilderFactory<T, B> factory, KlumJacksonInput input) Reads one owned Builder in the current Construction session without materializing it.<T> TreadRoot(Class<T> type, KlumJacksonInput input) Reads one root DSL Object through its normal Builder lifecycle.<T> TreadTemplate(Class<T> type, KlumJacksonInput input) Reads a value-only Template without running lifecycle callbacks or phases.static KlumJacksonImporterusing(com.fasterxml.jackson.databind.ObjectMapper mapper) CapturesObjectMapper.reader()once without changing the mapper.static KlumJacksonImporterusing(com.fasterxml.jackson.databind.ObjectReader reader) Captures an untyped, non-updating reader while preserving all of its caller configuration.
-
Method Details
-
using
CapturesObjectMapper.reader()once without changing the mapper.- Parameters:
mapper- caller-configured mapper- Returns:
- immutable importer using the mapper's current reader configuration
-
using
Captures an untyped, non-updating reader while preserving all of its caller configuration.- Parameters:
reader- caller-configured untyped reader- Returns:
- immutable importer retaining that reader
- Throws:
IllegalArgumentException- if the reader is typed or updates an existing value
-
readRoot
Reads one root DSL Object through its normal Builder lifecycle.- Type Parameters:
T- completed DSL model type- Parameters:
type- DSL model typeinput- one caller-owned Jackson input- Returns:
- the completed root model
-
readTemplate
Reads a value-only Template without running lifecycle callbacks or phases.- Type Parameters:
T- completed DSL model type- Parameters:
type- DSL model typeinput- one caller-owned Jackson input- Returns:
- marked value-only Template
-
readBuilder
public <T,B extends com.blackbuild.klum.ast.runtime.KlumBuilder<T>> B readBuilder(com.blackbuild.klum.ast.runtime.KlumFactory.BuilderFactory<T, B> factory, KlumJacksonInput input) Reads one owned Builder in the current Construction session without materializing it.- Type Parameters:
T- DSL model typeB- precise generated Builder type- Parameters:
factory- generated Builder-producing factoryinput- one caller-owned Jackson input- Returns:
- unsealed Builder from the active session
-
applyToBuilder
public <B extends com.blackbuild.klum.ast.runtime.KlumBuilder<?>> B applyToBuilder(B builder, KlumJacksonInput input) Applies one input to the same unsealed Builder in its active Construction session.- Type Parameters:
B- precise Builder type- Parameters:
builder- active unsealed Builderinput- one caller-owned Jackson input- Returns:
- the identical Builder instance
-