Class StringRenderer
java.lang.Object
dk.mada.jaxrs.generator.mpclient.StringRenderer
Renders text in various forms suitable for use in the templates.
Duplicates some of the logic in mustache rendering, but does so to allow for use of simpler templates.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidconsumeNonBlankEncoded(Optional<String> txt, Consumer<String> consumer) Encodes input text if it is non-blank for consumer.static StringencodeForString(String text) Encodes text for use in string-input.encodeForString(Optional<String> text) Encodes text for use in string-input.static StringencodeRegexp(String regexp) Encode regular expression to be used in an annotation argument.makeValidDtoJavadocSummary(String textIn) Make a summary valid for use in the DTO summary javadoc section.Make a summary valid for use in the API summary javadoc section.Make a summary valid for use in the property javadoc section.static StringQuote text.
-
Method Details
-
makeValidOperationJavadocSummary
-
makeValidDtoJavadocSummary
-
makeValidPropertyJavadocSummary
-
encodeForString
Encodes text for use in string-input. The text may contain multiple lines, but needs to be represented in the source code as a single string input. Used for descriptions and examples that need to be specified as @Schema inputs.- Parameters:
text- the text to be protected- Returns:
- a single-line string
-
encodeForString
Encodes text for use in string-input. The text may contain multiple lines, but needs to be represented in the source code as a single string input. Used for descriptions and examples that need to be specified as @Schema inputs.- Parameters:
text- the text to be protected- Returns:
- a single-line string
-
quote
-
encodeRegexp
-
consumeNonBlankEncoded
-