Package dk.mada.jaxrs.generator.mpclient
Class GeneratorOpts
java.lang.Object
dk.mada.jaxrs.generator.mpclient.GeneratorOpts
Generator configuration options.
Extracts generator-specific keys from the input properties provided by the user.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAuthorization header control.static final recordParser options leaked into the generator.static enumLine endings.static enumThe resolution to use when a property has conflicting declarations.static enumProperty sorting order.static enumControl of builders in records. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGeneratorOpts(OptionReader or, GeneratorOpts.LeakedParserOpts leakedParserOpts) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the package to generate API classes to.Returns the API package in path-form.Returns the package to generate DTO classes to.Returns the DTO package in path-form.Returns the id of this generator.Returns the optional additional API annotations.Returns the selection of how to render authorization header argument in resources.Returns the date-time implementation variant to use.Returns the default Api resource name.Returns mapping of external types.Returns the time the generation happened if enabled, or null.Returns the fully-qualified @Generated annotation class.Returns the optional jackson LocalDate deserializer class name.Returns the optional jackson LocalDate serializer class name.Returns the optional jackson LocalDateTime deserializer class name.Returns the optional jackson LocalDateTime serializer class name.Returns the optional LocalDateTime wire format for jackson.Returns the optional LocalDate wire format for jackson.Returns the optional jackson OffsetDateTime deserializer class name.Returns the optional jackson OffsetDateTime serializer class name.Returns the optional OffsetDateTime wire format for jackson.Returns optional json serialize options.Returns the line ending to use.Returns the optional MP client config key.Returns the MP providers.Returns the primitive type to use for integers without format.Returns the primitive type to use for numbers without format.Returns the property conflict resolution to use.Returns the property sorting order to use.Returns a predicate which will define which records to generate builders for.Returns list of media types that should be handled as input stream.Returns the list of DTO classes to skip when generating code.booleanReturns true if OpenApi @Schema annotations should be added.Returns the @Produces media type to use for void methods.booleanReturns true if the extra-template for a jackson LocalDate deserializer should be added, otherwise false.booleanReturns true if the extra-template for a jackson LocalDate serializer should be added, otherwise false.booleanReturns true if the extra-template for a jackson LocalDateTime deserializer should be added, otherwise false.booleanReturns true if the extra-template for a jackson LocalDateTime serializer should be added, otherwise false.booleanReturns true if the extra-template for a jackson OffsetDateTime deserializer should be added, otherwise false.booleanReturns true if the extra-template for a jackson OffsetDateTime serializer should be added, otherwise false.booleanReturns true if generation of API classes should use multipart bodies..booleanReturns true if DTOs should be generated as records instead of POJOs.booleanReturns true if rendering for jackson, otherwise false.booleanReturns true if rendering for jakarta, false if rendering for javax.booleanisJsonb()Returns true if rendering for jsonb, otherwise false.booleanReturns true if rendering with jspecify annotations.booleanReturns true if generation of API classes should be skipped..booleanReturns true if the destination folder should be kept during testing.booleanReturns true if wrapped primitives should be used in API parameters.booleanReturns true if bean validation should be used, otherwise false.booleanReturns true if BigDecimal should be used for double, otherwise use Double.booleanReturns true if boolean getters should use 'get' as prefix, otherwise use 'is'.booleanReturns true if collections should be initialized as empty, otherwise will be null.booleanReturns true if enumerations should deserialize unknown input to 'unknown_default_open_api'.booleanReturns true if a jackson date-time serializer should be rendered.booleanReturns true if a jackson LocalDate serializer should be rendered.booleanReturns true if a jackson LocalDateTime serializer should be rendered.booleanReturns true if a jackson OffsetDateTime serializer should be rendered.booleanReturns true if json serializer options should be used.booleanReturns true if date-time should be rendered with LocalDateTime.booleanReturns the extra MP validation rules.booleanReturns true if POJO DTOs should include null guards.booleanReturns true if the property order annotation should be rendered.booleanReturns true if record DTOs should include null-checks.booleanReturns true if @RegisterForReflection should be added to DTOs.booleanReturns true if DTOs should be marked with Serializable, otherwise false.booleanReturns true if DTOs should use create a toString generating single-line output.booleanReturns true if date-time should be rendered with ZonedDateTime.
-
Field Details
-
GENERATOR_API_PACKAGE
Generator option for API package.- See Also:
-
GENERATOR_DTO_PACKAGE
Generator option for DTO package.- See Also:
-
GENERATOR_USE_PROPERTY_CONFLICT_RESOLUTION
Generator option for property conflict resolution.- See Also:
-
GENERATOR_TYPE_NO_FORMAT_NUMBER
Generator option for no-format number- See Also:
-
-
Constructor Details
-
GeneratorOpts
Constructs a new instance.- Parameters:
or- option readerleakedParserOpts- leaked parser options
-
-
Method Details
-
generatorId
Returns the id of this generator. Used in the @Generator annotation in all generated files. Keep "dk.mada.jaxrs.Generator" as long as this is the only generator. (yes, it is the wrong class, but it does not matter much)- Returns:
- the id of this generator
-
apiPackage
Returns the package to generate API classes to .- Returns:
- the package to generate API classes to
-
apiPackageDir
Returns the API package in path-form.- Returns:
- the API package in path-form
-
dtoPackage
Returns the package to generate DTO classes to .- Returns:
- the package to generate DTO classes to
-
dtoPackageDir
Returns the DTO package in path-form.- Returns:
- the DTO package in path-form
-
isJackson
public boolean isJackson()Returns true if rendering for jackson, otherwise false.- Returns:
- true if rendering for jackson, otherwise false
-
isJsonb
public boolean isJsonb()Returns true if rendering for jsonb, otherwise false.- Returns:
- true if rendering for jsonb, otherwise false
-
isJakarta
public boolean isJakarta()Returns true if rendering for jakarta, false if rendering for javax.- Returns:
- true if rendering for jakarta, false if rendering for javax
-
isJspecify
public boolean isJspecify()Returns true if rendering with jspecify annotations.- Returns:
- true if rendering with jspecify annotations
-
isUseJsonSerializeOptions
public boolean isUseJsonSerializeOptions()Returns true if json serializer options should be used.- Returns:
- true if json serializer options should be used
-
getJsonSerializeOptions
Returns optional json serialize options.- Returns:
- optional json serialize options
-
isUseJacksonDateTimeSerializer
public boolean isUseJacksonDateTimeSerializer()Returns true if a jackson date-time serializer should be rendered.- Returns:
- true if a jackson date-time serializer should be rendered
-
isUseJacksonLocalDateSerializer
public boolean isUseJacksonLocalDateSerializer()Returns true if a jackson LocalDate serializer should be rendered.- Returns:
- true if a jackson LocalDate serializer should be rendered
-
isUseJacksonLocalDateTimeSerializer
public boolean isUseJacksonLocalDateTimeSerializer()Returns true if a jackson LocalDateTime serializer should be rendered.- Returns:
- true if a jackson LocalDateTime serializer should be rendered
-
isUseJacksonOffsetDateTimeSerializer
public boolean isUseJacksonOffsetDateTimeSerializer()Returns true if a jackson OffsetDateTime serializer should be rendered.- Returns:
- true if a jackson OffsetDateTime serializer should be rendered
-
getJacksonLocalDateWireFormat
Returns the optional LocalDate wire format for jackson.- Returns:
- the optional LocalDate wire format for jackson
-
getJacksonLocalDateTimeWireFormat
Returns the optional LocalDateTime wire format for jackson.- Returns:
- the optional LocalDateTime wire format for jackson
-
getJacksonLocalDateDeserializer
Returns the optional jackson LocalDate deserializer class name.- Returns:
- the optional jackson LocalDate deserializer class name
-
getJacksonLocalDateSerializer
Returns the optional jackson LocalDate serializer class name.- Returns:
- the optional jackson LocalDate serializer class name
-
getJacksonLocalDateTimeDeserializer
Returns the optional jackson LocalDateTime deserializer class name.- Returns:
- the optional jackson LocalDateTime deserializer class name
-
getJacksonLocalDateTimeSerializer
Returns the optional jackson LocalDateTime serializer class name.- Returns:
- the optional jackson LocalDateTime serializer class name
-
getJacksonOffsetDateTimeDeserializer
Returns the optional jackson OffsetDateTime deserializer class name.- Returns:
- the optional jackson OffsetDateTime deserializer class name
-
getJacksonOffsetDateTimeSerializer
Returns the optional jackson OffsetDateTime serializer class name.- Returns:
- the optional jackson OffsetDateTime serializer class name
-
getJacksonOffsetDateTimeWireFormat
Returns the optional OffsetDateTime wire format for jackson.- Returns:
- the optional OffsetDateTime wire format for jackson
-
isUseMpValidationRules
public boolean isUseMpValidationRules()Returns the extra MP validation rules.- Returns:
- the extra MP validation rules
-
getApiAdditionalAnnotations
Returns the optional additional API annotations.- Returns:
- the optional additional API annotations
-
getMpClientConfigKey
Returns the optional MP client config key.- Returns:
- the optional MP client config key
-
getMpProviders
Returns the MP providers.- Returns:
- the MP providers
-
getSkippedDtoClasses
Returns the list of DTO classes to skip when generating code.- Returns:
- the list of DTO classes to skip when generating code
-
getUseOpenapiSchema
public boolean getUseOpenapiSchema()Returns true if OpenApi @Schema annotations should be added.- Returns:
- true if OpenApi @Schema annotations should be added
-
isDtoRecords
public boolean isDtoRecords()Returns true if DTOs should be generated as records instead of POJOs.- Returns:
- true if DTOs should be generated as records instead of POJOs
-
isUseRecordsRequireNull
public boolean isUseRecordsRequireNull()Returns true if record DTOs should include null-checks.- Returns:
- true if record DTOs should include null-checks
-
isUsePojoRequireNonNull
public boolean isUsePojoRequireNonNull()Returns true if POJO DTOs should include null guards.- Returns:
- true if POJO DTOs should include null guards
-
getRecordBuilderPredicate
Returns a predicate which will define which records to generate builders for.- Returns:
- a predicate which will define which records to generate builders for
-
getExternalTypeMapping
Returns mapping of external types. Maps a (OpenApi document) type name (key) into its fully-qualified class name (value). The keySet serves as a set of DTOs *not* to generate.- Returns:
- mapping of types names to external type imports
-
isAddJacksonLocalDateDeserializerTemplate
public boolean isAddJacksonLocalDateDeserializerTemplate()Returns true if the extra-template for a jackson LocalDate deserializer should be added, otherwise false.- Returns:
- true if the extra-template for a jackson LocalDate deserializer should be added, otherwise false
-
isAddJacksonLocalDateSerializerTemplate
public boolean isAddJacksonLocalDateSerializerTemplate()Returns true if the extra-template for a jackson LocalDate serializer should be added, otherwise false.- Returns:
- true if the extra-template for a jackson LocalDate serializer should be added, otherwise false
-
isAddJacksonLocalDateTimeDeserializerTemplate
public boolean isAddJacksonLocalDateTimeDeserializerTemplate()Returns true if the extra-template for a jackson LocalDateTime deserializer should be added, otherwise false.- Returns:
- true if the extra-template for a jackson LocalDateTime deserializer should be added, otherwise false
-
isAddJacksonLocalDateTimeSerializerTemplate
public boolean isAddJacksonLocalDateTimeSerializerTemplate()Returns true if the extra-template for a jackson LocalDateTime serializer should be added, otherwise false.- Returns:
- true if the extra-template for a jackson LocalDateTime serializer should be added, otherwise false
-
isAddJacksonOffsetDateTimeDeserializerTemplate
public boolean isAddJacksonOffsetDateTimeDeserializerTemplate()Returns true if the extra-template for a jackson OffsetDateTime deserializer should be added, otherwise false.- Returns:
- true if the extra-template for a jackson OffsetDateTime deserializer should be added, otherwise false
-
isAddJacksonOffsetDateTimeSerializerTemplate
public boolean isAddJacksonOffsetDateTimeSerializerTemplate()Returns true if the extra-template for a jackson OffsetDateTime serializer should be added, otherwise false.- Returns:
- true if the extra-template for a jackson OffsetDateTime serializer should be added, otherwise false
-
isUseBeanValidation
public boolean isUseBeanValidation()Returns true if bean validation should be used, otherwise false.- Returns:
- true if bean validation should be used, otherwise false
-
isUseSerializable
public boolean isUseSerializable()Returns true if DTOs should be marked with Serializable, otherwise false.- Returns:
- true if DTOs should be marked with Serializable, otherwise false
-
isUseSingleLineToString
public boolean isUseSingleLineToString()Returns true if DTOs should use create a toString generating single-line output.- Returns:
- true if DTOs should use create a toString generating single-line output
-
isUseBigDecimalForDouble
public boolean isUseBigDecimalForDouble()Returns true if BigDecimal should be used for double, otherwise use Double.- Returns:
- true if BigDecimal should be used for double, otherwise use Double
-
isUseEmptyCollections
public boolean isUseEmptyCollections()Returns true if collections should be initialized as empty, otherwise will be null.- Returns:
- true if collections should be initialized as empty, otherwise will be null
-
isUseZonedDateTime
public boolean isUseZonedDateTime()Returns true if date-time should be rendered with ZonedDateTime.- Returns:
- true if date-time should be rendered with ZonedDateTime
-
isUseLocalDateTime
public boolean isUseLocalDateTime()Returns true if date-time should be rendered with LocalDateTime.- Returns:
- true if date-time should be rendered with LocalDateTime
-
isUseBooleanGetPrefix
public boolean isUseBooleanGetPrefix()Returns true if boolean getters should use 'get' as prefix, otherwise use 'is'.- Returns:
- true if boolean getters should use 'get' as prefix, otherwise use 'is'
-
getGeneratedAtTime
Returns the time the generation happened if enabled, or null.- Returns:
- the time the generation happened if enabled, or null
-
isUsePropertyOrderAnnotation
public boolean isUsePropertyOrderAnnotation()Returns true if the property order annotation should be rendered.- Returns:
- true if the property order annotation should be rendered
-
getGeneratorAnnotationClass
Returns the fully-qualified @Generated annotation class.- Returns:
- the fully-qualified @Generated annotation class
-
getLineEnding
Returns the line ending to use.- Returns:
- the line ending to use
-
getAuthHeaderSelection
Returns the selection of how to render authorization header argument in resources.- Returns:
- the selection of how to render authorization header argument in resources
-
getPropertyOrder
Returns the property sorting order to use.- Returns:
- the property sorting order to use
-
getPropertyConflictResolution
Returns the property conflict resolution to use.- Returns:
- the property conflict resolution to use
-
isUseEnumUnknownDefault
public boolean isUseEnumUnknownDefault()Returns true if enumerations should deserialize unknown input to 'unknown_default_open_api'.- Returns:
- true if enumerations should deserialize unknown input to 'unknown_default_open_api'
-
isUseApiWrappedPrimitives
public boolean isUseApiWrappedPrimitives()Returns true if wrapped primitives should be used in API parameters. API parameters representing primitives can use the primitives in the API (default) or their wrapper counterparts.- Returns:
- true if wrapped primitives should be used in API parameters
- See Also:
-
getDefaultApiName
Returns the default Api resource name.- Returns:
- the default Api resource name
-
getNoFormatIntegerType
Returns the primitive type to use for integers without format.- Returns:
- the primitive type to use for integers without format
-
getNoFormatNumberType
Returns the primitive type to use for numbers without format.- Returns:
- the primitive type to use for numbers without format
-
isApiUseMultipartForm
public boolean isApiUseMultipartForm()Returns true if generation of API classes should use multipart bodies..- Returns:
- true if generation of API classes should use multipart bodies.
-
isSkipApiClasses
public boolean isSkipApiClasses()Returns true if generation of API classes should be skipped..- Returns:
- true if generation of API classes should be skipped.
-
getVoidProducesMediaType
Returns the @Produces media type to use for void methods.- Returns:
- the @Produces media type to use for void methods
-
getResponseInputStreamMediaTypes
Returns list of media types that should be handled as input stream.- Returns:
- list of media types that should be handled as input stream
-
isUseRegisterForReflection
public boolean isUseRegisterForReflection()Returns true if @RegisterForReflection should be added to DTOs.- Returns:
- true if @RegisterForReflection should be added to DTOs
-
isTestingKeepDestination
public boolean isTestingKeepDestination()Returns true if the destination folder should be kept during testing.- Returns:
- true if the destination folder should be kept during testing
-
getDateTimeVariant
Returns the date-time implementation variant to use.- Returns:
- the date-time implementation variant to use
-