Class Naming

java.lang.Object
dk.mada.jaxrs.model.naming.Naming

public class Naming extends Object
Executes naming rules.
  • Field Details

    • PARSER_INTERNAL_PROPERTIES_NAME_MARKER

      public static final String PARSER_INTERNAL_PROPERTIES_NAME_MARKER
      Prefix DTO names for composite properties. This is only used internally in the parser.
      See Also:
  • Constructor Details

    • Naming

      public Naming(OptionReader or)
      Creates a new instance. The properties allow the user to customize naming rules.
      Parameters:
      or - the option reader
      See Also:
  • Method Details

    • isRenameCaseConflicts

      public boolean isRenameCaseConflicts()
      Returns true if types should be renamed to avoid conflicts on Windows.
      Returns:
      true if types should be renamed to avoid conflicts on Windows
    • getRenameCaseConflictSchemaOrder

      public NamingOpts.SchemaOrder getRenameCaseConflictSchemaOrder()
      Returns the schema order used when resolving naming conflicts.
      Returns:
      the schema order used when resolving naming conflicts
    • convertEntityName

      public String convertEntityName(String entityTypeName)
      Converts entity type name to entity variable name.
      Parameters:
      entityTypeName - the type name of the entity
      Returns:
      the entity variable name
    • convertEnumName

      public String convertEnumName(String enumerationEntryName)
      Converts enumeration entry value into enumeration constant name.
      Parameters:
      enumerationEntryName - the enumeration entry value
      Returns:
      the enumeration constant name
    • convertEnumNumberName

      public String convertEnumNumberName(String enumerationEntryName)
      Converts enumeration number entry value into enumeration constant name.
      Parameters:
      enumerationEntryName - the enumeration entry value
      Returns:
      the enumeration constant name
    • convertApiName

      public String convertApiName(String groupName)
      Converts an API group name into a java API class name.
      Parameters:
      groupName - the OpenApi group name
      Returns:
      the java API class name
    • convertTypeName

      public String convertTypeName(String schemaName)
      Converts a type OpenApi schema name into a java type name.
      Parameters:
      schemaName - OpenApi schema name
      Returns:
      the java type name
    • convertMultipartTypeName

      public String convertMultipartTypeName(String groupOpId)
      Converts a synthetic multipart dto name into a java type name. The input is on the form "group-operationid".
      Parameters:
      groupOpId - the group-operationid to base the name on
      Returns:
      the java type name
    • convertMpSchemaName

      public String convertMpSchemaName(String schemaName)
      Converts a type OpenApi schema name into its MP @Schema name.
      Parameters:
      schemaName - OpenApi schema name
      Returns:
      the MP @Schema name
    • renameConflictingName

      public String renameConflictingName(String name)
      Converts a conflicting name to a new name.
      Parameters:
      name - the name of the type
      Returns:
      the new name for the type
    • convertOperationName

      public String convertOperationName(String syntheticOperationName)
      Converts an operation name to a java method name. The synthetic operation name is created from path-httptype.
      Parameters:
      syntheticOperationName - the synthetic name
      Returns:
      the java method name
    • convertOperationIdName

      public Optional<String> convertOperationIdName(@Nullable String operationIdName)
      Converts an operationId name to a java method name. This is only used for methods that have a specified operationId.
      Parameters:
      operationIdName - the operationId name, or null
      Returns:
      the java method name
    • convertPropertyName

      public String convertPropertyName(String schemaFieldName)
      Converts a schema field name to a java property name.
      Parameters:
      schemaFieldName - the OpenApi schema field name
      Returns:
      the java property name
    • convertParameterName

      public String convertParameterName(String schemaParamName)
      Converts an operation parameter name to a java method argument name.
      Parameters:
      schemaParamName - the OpenApi schema parameter name
      Returns:
      the java method argument name
    • convertPropertyEnumTypeName

      public String convertPropertyEnumTypeName(String schemaPropertyName)
      Converts a DTO enumeration parameter name to an enumeration type name.
      Parameters:
      schemaPropertyName - the OpenApi schema property name
      Returns:
      the java enumeration type name