commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r1079249 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/EntityArrays.java
Date Tue, 08 Mar 2011 06:00:22 GMT
Author: bayard
Date: Tue Mar  8 06:00:22 2011
New Revision: 1079249

URL: http://svn.apache.org/viewvc?rev=1079249&view=rev
Log:
Adding javadoc

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/EntityArrays.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/EntityArrays.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/EntityArrays.java?rev=1079249&r1=1079248&r2=1079249&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/EntityArrays.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/EntityArrays.java
Tue Mar  8 06:00:22 2011
@@ -27,6 +27,10 @@ package org.apache.commons.lang3.text.tr
  */
 public class EntityArrays {
 
+    /**
+     * Mapping to escape <a href="https://secure.wikimedia.org/wikipedia/en/wiki/ISO/IEC_8859-1">ISO-8859-1</a>
+     * characters to their named HTML 3.x equivalents. 
+     */
     public static String[][] ISO8859_1_ESCAPE() { return ISO8859_1_ESCAPE.clone(); }
     private static final String[][] ISO8859_1_ESCAPE = {
         {"\u00A0", "&nbsp;"}, // non-breaking space
@@ -127,10 +131,17 @@ public class EntityArrays {
         {"\u00FF", "&yuml;"}, // ΓΏ - lowercase y, umlaut
     };
 
+    /**
+     * Reverse of {@link #ISO8859_1_ESCAPE()} for unescaping purposes.
+     */
     public static String[][] ISO8859_1_UNESCAPE() { return ISO8859_1_UNESCAPE.clone(); }
     private static final String[][] ISO8859_1_UNESCAPE = invert(ISO8859_1_ESCAPE);
 
-    // http://www.w3.org/TR/REC-html40/sgml/entities.html
+    /**
+     * Mapping to escape additional <a href="http://www.w3.org/TR/REC-html40/sgml/entities.html">character
entity 
+     * references</a>. Note that this must be used with {@link #ISO8859_1_ESCAPE()}
to get the full list of 
+     * HTML 4.0 character entities.
+     */
     public static String[][] HTML40_EXTENDED_ESCAPE() { return HTML40_EXTENDED_ESCAPE.clone();
}
     private static final String[][] HTML40_EXTENDED_ESCAPE = {
         // <!-- Latin Extended-B -->
@@ -329,9 +340,17 @@ public class EntityArrays {
         {"\u20AC", "&euro;"}, // -- euro sign, U+20AC NEW -->
     };
 
+    /**
+     * Reverse of {@link #HTML40_EXTENDED_ESCAPE()} for unescaping purposes.
+     */
     public static String[][] HTML40_EXTENDED_UNESCAPE() { return HTML40_EXTENDED_UNESCAPE.clone();
}
     private static final String[][] HTML40_EXTENDED_UNESCAPE = invert(HTML40_EXTENDED_ESCAPE);
 
+    /**
+     * Mapping to escape the basic XML and HTML character entities.
+     *
+     * Namely: {@code " & < >}
+     */
     public static String[][] BASIC_ESCAPE() { return BASIC_ESCAPE.clone(); }
     private static final String[][] BASIC_ESCAPE = {
         {"\"", "&quot;"}, // " - double-quote
@@ -340,17 +359,31 @@ public class EntityArrays {
         {">", "&gt;"},    // > - greater-than
     };
 
+    /**
+     * Reverse of {@link #BASIC_ESCAPE()} for unescaping purposes.
+     */
     public static String[][] BASIC_UNESCAPE() { return BASIC_UNESCAPE.clone(); }
     private static final String[][] BASIC_UNESCAPE = invert(BASIC_ESCAPE);
 
+    /**
+     * Mapping to escape the apostrophe character to its XML character entity. 
+     */
     public static String[][] APOS_ESCAPE() { return APOS_ESCAPE.clone(); }
     private static final String[][] APOS_ESCAPE = {
         {"'", "&apos;"}, // XML apostrophe
     };
 
+    /**
+     * Reverse of {@link #APOS_ESCAPE()} for unescaping purposes.
+     */
     public static String[][] APOS_UNESCAPE() { return APOS_UNESCAPE.clone(); }
     private static final String[][] APOS_UNESCAPE = invert(APOS_ESCAPE);
 
+    /**
+     * Mapping to escape the Java control characters. 
+     *
+     * Namely: {@code \b \n \t \f \r}
+     */
     public static String[][] JAVA_CTRL_CHARS_ESCAPE() { return JAVA_CTRL_CHARS_ESCAPE.clone();
}
     private static final String[][] JAVA_CTRL_CHARS_ESCAPE = {
         {"\b", "\\b"},
@@ -360,6 +393,9 @@ public class EntityArrays {
         {"\r", "\\r"}
     };
 
+    /**
+     * Reverse of {@link #JAVA_CTRL_CHARS_ESCAPE()} for unescaping purposes.
+     */
     public static String[][] JAVA_CTRL_CHARS_UNESCAPE() { return JAVA_CTRL_CHARS_UNESCAPE.clone();
}
     private static final String[][] JAVA_CTRL_CHARS_UNESCAPE = invert(JAVA_CTRL_CHARS_ESCAPE);
 



Mime
View raw message