Skip to content

Commit ccb13fb

Browse files
committed
Javadoc
1 parent 23f0816 commit ccb13fb

File tree

1 file changed

+32
-14
lines changed

1 file changed

+32
-14
lines changed

src/main/java/org/apache/commons/lang3/StringEscapeUtils.java

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -584,28 +584,46 @@ public static final String escapeXml(final String input) {
584584

585585
/**
586586
* Escapes the characters in a {@link String} using XML entities.
587+
* <p>
588+
* For example:
589+
* </p>
587590
*
588-
* <p>For example: {@code "bread" & "butter"} =&gt;
589-
* {@code &quot;bread&quot; &amp; &quot;butter&quot;}.
591+
* <pre>{@code
592+
* "bread" & "butter"
593+
* }</pre>
594+
* <p>
595+
* converts to:
590596
* </p>
591597
*
592-
* <p>Note that XML 1.0 is a text-only format: it cannot represent control
593-
* characters or unpaired Unicode surrogate code points, even after escaping.
594-
* {@code escapeXml10} will remove characters that do not fit in the
595-
* following ranges:</p>
598+
* <pre>
599+
* {@code
600+
* &quot;bread&quot; &amp; &quot;butter&quot;
601+
* }
602+
* </pre>
603+
*
604+
* <p>
605+
* Note that XML 1.0 is a text-only format: it cannot represent control characters or unpaired Unicode surrogate code points, even after escaping. The
606+
* method {@code escapeXml10} will remove characters that do not fit in the following ranges:
607+
* </p>
596608
*
597-
* <p>{@code #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]}</p>
609+
* <p>
610+
* {@code #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]}
611+
* </p>
598612
*
599-
* <p>Though not strictly necessary, {@code escapeXml10} will escape
600-
* characters in the following ranges:</p>
613+
* <p>
614+
* Though not strictly necessary, {@code escapeXml10} will escape characters in the following ranges:
615+
* </p>
601616
*
602-
* <p>{@code [#x7F-#x84] | [#x86-#x9F]}</p>
617+
* <p>
618+
* {@code [#x7F-#x84] | [#x86-#x9F]}
619+
* </p>
603620
*
604-
* <p>The returned string can be inserted into a valid XML 1.0 or XML 1.1
605-
* document. If you want to allow more non-text characters in an XML 1.1
606-
* document, use {@link #escapeXml11(String)}.</p>
621+
* <p>
622+
* The returned string can be inserted into a valid XML 1.0 or XML 1.1 document. If you want to allow more non-text characters in an XML 1.1 document, use
623+
* {@link #escapeXml11(String)}.
624+
* </p>
607625
*
608-
* @param input the {@link String} to escape, may be null
626+
* @param input the {@link String} to escape, may be null
609627
* @return a new escaped {@link String}, {@code null} if null string input
610628
* @see #unescapeXml(String)
611629
* @since 3.3

0 commit comments

Comments
 (0)