Class GeneratorOpts

java.lang.Object
dk.mada.jaxrs.generator.mpclient.GeneratorOpts

public final class GeneratorOpts extends Object
Generator configuration options. Extracts generator-specific keys from the input properties provided by the user.
  • Field Details

    • GENERATOR_API_PACKAGE

      public static final String GENERATOR_API_PACKAGE
      Generator option for API package.
      See Also:
    • GENERATOR_DTO_PACKAGE

      public static final String GENERATOR_DTO_PACKAGE
      Generator option for DTO package.
      See Also:
    • GENERATOR_USE_PROPERTY_CONFLICT_RESOLUTION

      public static final String GENERATOR_USE_PROPERTY_CONFLICT_RESOLUTION
      Generator option for property conflict resolution.
      See Also:
    • GENERATOR_TYPE_NO_FORMAT_NUMBER

      public static final String GENERATOR_TYPE_NO_FORMAT_NUMBER
      Generator option for no-format number
      See Also:
  • Constructor Details

  • Method Details

    • generatorId

      public String 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

      public String apiPackage()
      Returns the package to generate API classes to .
      Returns:
      the package to generate API classes to
    • apiPackageDir

      public String apiPackageDir()
      Returns the API package in path-form.
      Returns:
      the API package in path-form
    • dtoPackage

      public String dtoPackage()
      Returns the package to generate DTO classes to .
      Returns:
      the package to generate DTO classes to
    • dtoPackageDir

      public String 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

      public Optional<String> 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

      public Optional<String> getJacksonLocalDateWireFormat()
      Returns the optional LocalDate wire format for jackson.
      Returns:
      the optional LocalDate wire format for jackson
    • getJacksonLocalDateTimeWireFormat

      public Optional<String> getJacksonLocalDateTimeWireFormat()
      Returns the optional LocalDateTime wire format for jackson.
      Returns:
      the optional LocalDateTime wire format for jackson
    • getJacksonLocalDateDeserializer

      public Optional<String> getJacksonLocalDateDeserializer()
      Returns the optional jackson LocalDate deserializer class name.
      Returns:
      the optional jackson LocalDate deserializer class name
    • getJacksonLocalDateSerializer

      public Optional<String> getJacksonLocalDateSerializer()
      Returns the optional jackson LocalDate serializer class name.
      Returns:
      the optional jackson LocalDate serializer class name
    • getJacksonLocalDateTimeDeserializer

      public Optional<String> getJacksonLocalDateTimeDeserializer()
      Returns the optional jackson LocalDateTime deserializer class name.
      Returns:
      the optional jackson LocalDateTime deserializer class name
    • getJacksonLocalDateTimeSerializer

      public Optional<String> getJacksonLocalDateTimeSerializer()
      Returns the optional jackson LocalDateTime serializer class name.
      Returns:
      the optional jackson LocalDateTime serializer class name
    • getJacksonOffsetDateTimeDeserializer

      public Optional<String> getJacksonOffsetDateTimeDeserializer()
      Returns the optional jackson OffsetDateTime deserializer class name.
      Returns:
      the optional jackson OffsetDateTime deserializer class name
    • getJacksonOffsetDateTimeSerializer

      public Optional<String> getJacksonOffsetDateTimeSerializer()
      Returns the optional jackson OffsetDateTime serializer class name.
      Returns:
      the optional jackson OffsetDateTime serializer class name
    • getJacksonOffsetDateTimeWireFormat

      public Optional<String> getJacksonOffsetDateTimeWireFormat()
      Returns the optional OffsetDateTime wire format for jackson.
      Returns:
      the optional OffsetDateTime wire format for jackson
    • getMpClientConfigKey

      public Optional<String> getMpClientConfigKey()
      Returns the optional MP client config key.
      Returns:
      the optional MP client config key
    • getMpProviders

      public List<String> getMpProviders()
      Returns the MP providers.
      Returns:
      the MP providers
    • getSkippedDtoClasses

      public List<String> getSkippedDtoClasses()
      Returns the list of DTO classes to skip when generating code.
      Returns:
      the list of DTO classes to skip when generating code
    • getExternalTypeMapping

      public Map<String,UserMappedImport> 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

      public Optional<String> 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

      public String getGeneratorAnnotationClass()
      Returns the fully-qualified @Generated annotation class.
      Returns:
      the fully-qualified @Generated annotation class
    • getPropertyOrder

      public GeneratorOpts.PropertyOrder getPropertyOrder()
      Returns the property sorting order to use.
      Returns:
      the property sorting order to use
    • getPropertyConflictResolution

      public GeneratorOpts.PropertyConflictResolution 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

      public Optional<String> getDefaultApiName()
      Returns the default Api resource name.
      Returns:
      the default Api resource name
    • getNoFormatIntegerType

      public String getNoFormatIntegerType()
      Returns the primitive type to use for integers without format.
      Returns:
      the primitive type to use for integers without format
    • getNoFormatNumberType

      public String 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

      public Optional<String> getVoidProducesMediaType()
      Returns the @Produces media type to use for void methods.
      Returns:
      the @Produces media type to use for void methods
    • getResponseInputStreamMediaTypes

      public List<String> 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

      public TypeDateTime.DateTimeVariant getDateTimeVariant()
      Returns the date-time implementation variant to use.
      Returns:
      the date-time implementation variant to use