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
Modifier and TypeClassDescriptionstatic final record
Parser options leaked into the generator.static enum
The resolution to use when a property has conflicting declarations.static enum
Property sorting order. -
Field Summary
-
Constructor Summary
ConstructorDescriptionGeneratorOpts
(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 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 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 list of media types that should be handled as input stream.Returns the list of DTO classes to skip when generating code.Returns the @Produces media type to use for void methods.boolean
Returns true if the extra-template for a jackson LocalDate deserializer should be added, otherwise false.boolean
Returns true if the extra-template for a jackson LocalDate serializer should be added, otherwise false.boolean
Returns true if the extra-template for a jackson LocalDateTime deserializer should be added, otherwise false.boolean
Returns true if the extra-template for a jackson LocalDateTime serializer should be added, otherwise false.boolean
Returns true if the extra-template for a jackson OffsetDateTime deserializer should be added, otherwise false.boolean
Returns true if the extra-template for a jackson OffsetDateTime serializer should be added, otherwise false.boolean
Returns true if generation of API classes should use multipart bodies..boolean
Returns true if rendering for jackson, otherwise false.boolean
Returns true if rendering for jakarta, false if rendering for javax.boolean
isJsonb()
Returns true if rendering for jsonb, otherwise false.boolean
Returns true if generation of API classes should be skipped..boolean
Returns true if the destination folder should be kept during testing.boolean
Returns true if wrapped primitives should be used in API parameters.boolean
Returns true if bean validation should be used, otherwise false.boolean
Returns true if BigDecimal should be used for double, otherwise use Double.boolean
Returns true if boolean getters should use 'get' as prefix, otherwise use 'is'.boolean
Returns true if collections should be initialized as empty, otherwise will be null.boolean
Returns true if enumerations should deserialize unknown input to 'unknown_default_open_api'.boolean
Returns true if a jackson date-time serializer should be rendered.boolean
Returns true if a jackson LocalDate serializer should be rendered.boolean
Returns true if a jackson LocalDateTime serializer should be rendered.boolean
Returns true if a jackson OffsetDateTime serializer should be rendered.boolean
Returns true if json serializer options should be used.boolean
Returns true if date-time should be rendered with LocalDateTime.boolean
Returns true if the property order annotation should be rendered.boolean
Returns true if @RegisterForReflection should be added to DTOs.boolean
Returns true if DTOs should be marked with Serializable, otherwise false.boolean
Returns true if DTOs should use create a toString generating single-line output.boolean
Returns 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
-
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
-
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
-
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
-
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
-