public void writeDocString(String contents) {
        writeWithNoFormatting("/**");

        // Split out any HTML-tag wrapped sections as we do not want to wrap
        // any customer documentation with tags
        Matcher matcher = PATTERN.matcher(contents);
        int lastMatchPos = 0;
        writeInlineWithNoFormatting(" * ");
        while (matcher.find()) {
            // write all contents up to the match.
            writeDocStringLine(contents.substring(lastMatchPos, matcher.start()));

            // write match contents
            writeInlineWithNoFormatting(contents.substring(matcher.start(), matcher.end()).replace("\n", "\n * "));
            lastMatchPos = matcher.end();
        }

        // Write out all remaining contents
        writeDocStringLine(contents.substring(lastMatchPos));
        writeWithNoFormatting("\n */");
    }
Writes the provided text in the format of a Java doc string.

@param contents text to format as a doc string.
smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/writer/TraitCodegenWriter.java