Class EnumGenerator
java.lang.Object
dk.mada.jaxrs.generator.mpclient.dto.EnumGenerator
Enumeration generator.
Prepares an enumeration context for template rendering.
-
Constructor Summary
ConstructorsConstructorDescriptionEnumGenerator
(Naming naming, GeneratorOpts opts) Constructs a new generator. -
Method Summary
Modifier and TypeMethodDescriptionbuildEnumSchemaForType
(dk.mada.jaxrs.generator.mpclient.dto.DtoSubjectDefiner.DtoSubjectBase dsb, Type type, CtxEnum ctxEnum) If the enumeration values are not represented correctly by the constants, define a schema with the proper values.Prepares enumeration context for rendering.
-
Constructor Details
-
EnumGenerator
Constructs a new generator.- Parameters:
naming
- the naming instanceopts
- the generator options
-
-
Method Details
-
toCtxEnum
Prepares enumeration context for rendering.- Parameters:
enumType
- the enumeration typevalues
- the enumeration values- Returns:
- the enumeration context
-
buildEnumSchemaForType
public Optional<String> buildEnumSchemaForType(dk.mada.jaxrs.generator.mpclient.dto.DtoSubjectDefiner.DtoSubjectBase dsb, Type type, CtxEnum ctxEnum) If the enumeration values are not represented correctly by the constants, define a schema with the proper values.- Parameters:
dsb
- the DTO subjecttype
- the type to define schema for (which may differ from the subject's!)ctxEnum
- enumeration constants and values- Returns:
- optional schema enumeration arguments
-