Class BaseCollector
java.lang.Object
io.github.torand.openapi2java.collectors.BaseCollector
- Direct Known Subclasses:
EnumInfoCollector,MethodInfoCollector,OpenApiDefInfoCollector,PojoInfoCollector,PropertyInfoCollector,ResourceInfoCollector,SecurityRequirementCollector,TypeInfoCollector
Base class for all collectors.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseCollector(Options opts) Constructs aBaseCollectorobject. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringdirPath2PackagePath(String dirPath) Converts a directory path into a package path.protected StringformatAnnotationDefaultParam(List<String> value) Formats a default parameter value for an annotation.protected StringformatAnnotationNamedParam(List<String> value) Formats a named parameter for an annotation.protected StringformatClassRef(String className) Formats given class name to language specific class reference.protected StringformatDeprecationMessage(Map<String, Object> extensionsByName) Formats a deprecation message.protected StringformatInnerAnnotation(String annotation, Object... args) Formats an annotation for use as parameter value for an outer annotation.protected ConstantValuegetHeaderNameConstant(String name) Gets header name constant from specified header name.protected StringmodelName2SchemaName(String modelName) Converts a model (pojo) name into a schema name.protected StringnormalizeDescription(String description) Modifies the description text for further use in code generation.protected StringnormalizePath(String path) Modifies the path string for further use in code generation.
-
Field Details
-
opts
The plugin options.
-
-
Constructor Details
-
BaseCollector
Constructs aBaseCollectorobject.- Parameters:
opts- the plugin options.
-
-
Method Details
-
normalizeDescription
Modifies the description text for further use in code generation.- Parameters:
description- the original description text.- Returns:
- the normalized description.
-
normalizePath
Modifies the path string for further use in code generation.- Parameters:
path- the original path string.- Returns:
- the normalized path.
-
dirPath2PackagePath
Converts a directory path into a package path.- Parameters:
dirPath- the directory path.- Returns:
- the package path.
-
modelName2SchemaName
Converts a model (pojo) name into a schema name.- Parameters:
modelName- the model name.- Returns:
- the schema name.
-
formatClassRef
Formats given class name to language specific class reference.- Parameters:
className- the class name.- Returns:
- the class reference.
-
formatInnerAnnotation
Formats an annotation for use as parameter value for an outer annotation.- Parameters:
annotation- the inner annotation.args- annotation string arguments.- Returns:
- the formatted annotation.
-
formatAnnotationDefaultParam
Formats a default parameter value for an annotation.- Parameters:
value- the parameter value- Returns:
- the formatted parameter.
-
formatAnnotationNamedParam
Formats a named parameter for an annotation.- Parameters:
value- the parameter value.- Returns:
- the formatted parameter.
-
formatDeprecationMessage
Formats a deprecation message.- Parameters:
extensionsByName- the OpenAPI extensions containing a custom deprecation message, or not.- Returns:
- the formatted deprecation message.
-
getHeaderNameConstant
Gets header name constant from specified header name.- Parameters:
name- the header name.- Returns:
- the header name constant.
-