Class EnumGenerator

java.lang.Object
dk.mada.jaxrs.generator.mpclient.dto.EnumGenerator

public class EnumGenerator extends Object
Enumeration generator. Prepares an enumeration context for template rendering.
  • Constructor Details

    • EnumGenerator

      public EnumGenerator(Naming naming, GeneratorOpts opts)
      Constructs a new generator.
      Parameters:
      naming - the naming instance
      opts - the generator options
  • Method Details

    • toCtxEnum

      public CtxEnum toCtxEnum(Type enumType, List<String> values)
      Prepares enumeration context for rendering.
      Parameters:
      enumType - the enumeration type
      values - 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 subject
      type - the type to define schema for (which may differ from the subject's!)
      ctxEnum - enumeration constants and values
      Returns:
      optional schema enumeration arguments