Package dk.mada.jaxrs.model.naming
Class Naming
java.lang.Object
dk.mada.jaxrs.model.naming.Naming
Executes naming rules.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvertApiName
(String groupName) Converts an API group name into a java API class name.convertEntityName
(String entityTypeName) Converts entity type name to entity variable name.convertEnumName
(String enumerationEntryName) Converts enumeration entry value into enumeration constant name.convertEnumNumberName
(String enumerationEntryName) Converts enumeration number entry value into enumeration constant name.convertMpSchemaName
(String schemaName) Converts a type OpenApi schema name into its MP @Schema name.convertMultipartTypeName
(String groupOpId) Converts a synthetic multipart dto name into a java type name.convertOperationIdName
(@Nullable String operationIdName) Converts an operationId name to a java method name.convertOperationName
(String syntheticOperationName) Converts an operation name to a java method name.convertParameterName
(String schemaParamName) Converts an operation parameter name to a java method argument name.convertPropertyEnumTypeName
(String schemaPropertyName) Converts a DTO enumeration parameter name to an enumeration type name.convertPropertyName
(String schemaFieldName) Converts a schema field name to a java property name.convertTypeName
(String schemaName) Converts a type OpenApi schema name into a java type name.Returns the schema order used when resolving naming conflicts.boolean
Returns true if types should be renamed to avoid conflicts on Windows.renameConflictingName
(String name) Converts a conflicting name to a new name.
-
Field Details
-
PARSER_INTERNAL_PROPERTIES_NAME_MARKER
Prefix DTO names for composite properties. This is only used internally in the parser.- See Also:
-
-
Constructor Details
-
Naming
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
Returns the schema order used when resolving naming conflicts.- Returns:
- the schema order used when resolving naming conflicts
-
convertEntityName
Converts entity type name to entity variable name.- Parameters:
entityTypeName
- the type name of the entity- Returns:
- the entity variable name
-
convertEnumName
Converts enumeration entry value into enumeration constant name.- Parameters:
enumerationEntryName
- the enumeration entry value- Returns:
- the enumeration constant name
-
convertEnumNumberName
Converts enumeration number entry value into enumeration constant name.- Parameters:
enumerationEntryName
- the enumeration entry value- Returns:
- the enumeration constant name
-
convertApiName
Converts an API group name into a java API class name.- Parameters:
groupName
- the OpenApi group name- Returns:
- the java API class name
-
convertTypeName
Converts a type OpenApi schema name into a java type name.- Parameters:
schemaName
- OpenApi schema name- Returns:
- the java type name
-
convertMultipartTypeName
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
Converts a type OpenApi schema name into its MP @Schema name.- Parameters:
schemaName
- OpenApi schema name- Returns:
- the MP @Schema name
-
renameConflictingName
Converts a conflicting name to a new name.- Parameters:
name
- the name of the type- Returns:
- the new name for the type
-
convertOperationName
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
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
Converts a schema field name to a java property name.- Parameters:
schemaFieldName
- the OpenApi schema field name- Returns:
- the java property name
-
convertParameterName
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
Converts a DTO enumeration parameter name to an enumeration type name.- Parameters:
schemaPropertyName
- the OpenApi schema property name- Returns:
- the java enumeration type name
-