alex 2003/07/05 16:37:30 Modified: lang/src/java/org/apache/commons/lang StringEscapeUtils.java Log: javadoc fixes Revision Changes Path 1.15 +9 -7 jakarta-commons/lang/src/java/org/apache/commons/lang/StringEscapeUtils.java Index: StringEscapeUtils.java =================================================================== RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringEscapeUtils.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- StringEscapeUtils.java 5 Jul 2003 19:04:31 -0000 1.14 +++ StringEscapeUtils.java 5 Jul 2003 23:37:30 -0000 1.15 @@ -60,7 +60,7 @@ import org.apache.commons.lang.exception.NestableRuntimeException; /** - * <p>Escapes and unescapes <code>String</code>s for Java, Java Script, HTML, and XML. + * <p>Escapes and unescapes <code>String</code>s for Java, Java Script, HTML, XML, and SQL. * * <p>Originally from * <a href="http://jakarta.apache.org/turbine/">Turbine</a> and the @@ -427,8 +427,8 @@ * <p>Unescapes a string containing entity escapes to a string * containing the actual Unicode characters corresponding to the * escapes. Supports HTML 4.0 entities.</p> - * <p>For example, the string "&lt;Françla;ais&gt;" - * will become "<Fran\u00E7ais>"</p> + * <p>For example, the string "&lt;Fran&ccedil;ais&gt;" + * will become "<Français>"</p> * <p>If an entity is unrecognized, it is left alone, and inserted * verbatim into the result string. e.g. "&gt;&zzzz;x" will * become ">&zzzz;x".</p> @@ -480,11 +480,13 @@ /** * Escapes the characters in a <code>String</code> to be suitable to pass to * an SQL query. For example, - * <code>statement.executeQuery("SELECT * FROM MOVIES WHERE TITLE='" + StringEscapeUtils.escapeSql("McHale's Navy") + "'");</code> - * Presently, this method only turns single-quotes into doubled single-quotes. + * <pre>statement.executeQuery("SELECT * FROM MOVIES WHERE TITLE='" + + * StringEscapeUtils.escapeSql("McHale's Navy") + + * "'");</pre> + * At present, this method only turns single-quotes into doubled single-quotes (<code>"McHale's Navy"</code> => <code>"McHale''s Navy"</code>). * It does not handle the cases of percent (%) or underscore (_) for use in LIKE clauses. * see http://www.jguru.com/faq/view.jsp?EID=8881 - * @param s + * @param s the string to escape * @return A new String, escaped for SQL */ public static String escapeSql(String s)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]