Skip to content

Commit

Permalink
SAK-43103 javadoc; Deprecated utils.FormattedText => api.FormattedText (
Browse files Browse the repository at this point in the history
sakaiproject#7827)

* SAK-43103 javadoc; Deprecated utils.FormattedText => api.FormattedText

* SAK-43103 javadoc
  • Loading branch information
axxter99 authored Jan 31, 2020
1 parent 12c7ab3 commit aabf811
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public class Validator
* @param value
* The string to escape.
* @return value fully escaped for HTML.
* @deprecated this is a passthrough for {@link FormattedText#escapeHtml(String, boolean)} so use that instead
* @deprecated this is a passthrough for {@link org.sakaiproject.util.api.FormattedText#escapeHtml(String, boolean)} so use that instead
*/
public static String escapeHtml(String value)
{
Expand All @@ -115,7 +115,7 @@ public static String escapeHtml(String value)

/**
* Escape plaintext for display inside a plain textarea.
* @deprecated this is a passthrough for {@link FormattedText#escapeHtml(String, boolean)} so use that instead
* @deprecated this is a passthrough for {@link org.sakaiproject.util.api.FormattedText#escapeHtml(String, boolean)} so use that instead
*/
public static String escapeHtmlTextarea(String value)
{
Expand All @@ -124,7 +124,7 @@ public static String escapeHtmlTextarea(String value)

/**
* Escape HTML-formatted text in preparation to include it in an HTML document.
* @deprecated this is a passthrough for {@link FormattedText#escapeHtmlFormattedText(String)} so use that instead
* @deprecated this is a passthrough for {@link org.sakaiproject.util.api.FormattedText#escapeHtmlFormattedText(String)} so use that instead
*/
public static String escapeHtmlFormattedText(String value)
{
Expand All @@ -137,7 +137,7 @@ public static String escapeHtmlFormattedText(String value)
* @param value
* The formatted text to escape
* @return The string to use as the value of the formatted textarea widget
* @deprecated this is a passthrough for {@link FormattedText#escapeHtmlFormattedTextarea(String)} so use that instead
* @deprecated this is a passthrough for {@link org.sakaiproject.util.api.FormattedText#escapeHtmlFormattedTextarea(String)} so use that instead
*/
public static String escapeHtmlFormattedTextarea(String value)
{
Expand All @@ -150,7 +150,7 @@ public static String escapeHtmlFormattedTextarea(String value)
* @param value
* The string to escape.
* @return value fully escaped using javascript / html identifier rules.
* @deprecated use commons-lang StringEscapeUtils
* @deprecated use commons-text {@link org.apache.commons.text.StringEscapeUtils}
*/
public static String escapeJavascript(String value)
{
Expand Down Expand Up @@ -196,13 +196,13 @@ public static String escapeJavascript(String value)
* One reason for this existing is that the standard URLEncoder in Java will encode slashes ('/') but this method doesn't.
* Also watch out as it trims trailing spaces, and other character get lost here too.
*
* Note: java.net.URLEncode.encode() provides a more standard option
* FormattedText.decodeNumericCharacterReferences() undoes this op
* Note: {@link java.net.URLEncode#encode(String, String)} provides a more standard option
* {@link FormattedText#decodeNumericCharacterReferences(String)} undoes this op
*
* @param id
* The string to escape.
* @return id fully escaped using URL rules.
* @deprecated use java.net.URLEncode.encode()
* @deprecated use {@link java.net.URLEncode#encode(String, String)}
*/
public static String escapeUrl(String id)
{
Expand Down Expand Up @@ -251,7 +251,7 @@ else if ((ESCAPE_URL.indexOf((char) b) != -1) || (b <= 0x1F) || (b == 0x7F) || (

/**
* Is this a valid local part of an email id?
* @deprecated use commons-validator EmailValidator
* @deprecated use commons-validator {@link org.apache.commons.validator.routines.EmailValidator}
*/
public static boolean checkEmailLocal(String id)
{
Expand Down
23 changes: 16 additions & 7 deletions kernel/kernel-util/src/main/java/org/sakaiproject/util/Web.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class Web
* @param value
* The string to escape.
* @return value fully escaped for HTML.
* @deprecated this is a passthrough for {@link FormattedText#escapeHtml(String, boolean)} so use that instead
* @deprecated this is a passthrough for {@link org.sakaiproject.util.api.FormattedText#escapeHtml(String, boolean)} so use that instead
*/
public static String escapeHtml(String value)
{
Expand All @@ -70,7 +70,7 @@ public static String escapeHtml(String value)
* @param value
* The string to escape.
* @return value escaped for HTML.
* @deprecated this is a passthrough for {@link FormattedText#escapeHtmlFormattedText(String)} so use that instead
* @deprecated this is a passthrough for {@link org.sakaiproject.util.api.FormattedText#escapeHtmlFormattedText(String)} so use that instead
*/
public static String escapeHtmlFormattedText(String value)
{
Expand All @@ -85,7 +85,7 @@ public static String escapeHtmlFormattedText(String value)
* @param escapeNewlines
* Whether to escape newlines as "&lt;br /&gt;\n" so that they appear as HTML line breaks.
* @return value fully escaped for HTML.
* @deprecated this is a passthrough for {@link FormattedText#escapeHtml(String, boolean)} so use that instead
* @deprecated this is a passthrough for {@link org.sakaiproject.util.api.FormattedText#escapeHtml(String, boolean)} so use that instead
*/
public static String escapeHtml(String value, boolean escapeNewlines) {
return FormattedText.escapeHtml(value, escapeNewlines);
Expand All @@ -97,7 +97,7 @@ public static String escapeHtml(String value, boolean escapeNewlines) {
* @param value
* The string to escape.
* @return value escaped.
* @deprecated just a passthrough for {@link FormattedText#escapeJsQuoted(String)} so use that instead
* @deprecated just a passthrough for {@link org.sakaiproject.util.api.FormattedText#escapeJsQuoted(String)} so use that instead
*/
public static String escapeJsQuoted(String value)
{
Expand All @@ -113,7 +113,7 @@ public static String escapeJsQuoted(String value)
* @param id
* The string to escape.
* @return id fully escaped using URL rules.
* @deprecated just a passthrough for {@link Validator#escapeUrl(String)} so use that instead
* @deprecated just a passthrough for {@link java.net.URLEncode#encode(String, String)} so use that instead
*/
public static String escapeUrl(String id)
{
Expand Down Expand Up @@ -168,6 +168,8 @@ public static String encodeUrlsAsHtml(String text)
* @param value
* The string to escape.
* @return value fully escaped using javascript / html identifier rules.
*
* @deprecated use commons-text {@link org.apache.commons.text.StringEscapeUtils}
*/
public static String escapeJavascript(String value)
{
Expand Down Expand Up @@ -358,13 +360,20 @@ public static void sendAutoUpdate(PrintWriter out, HttpServletRequest req, Strin
* @param req
* The request.
* @return The URL back to this server based on the current request.
* @deprecated use RequestFilter.serverUrl
* @deprecated use {@link RequestFilter.serverUrl}
*/
public static String serverUrl(HttpServletRequest req)
{
return RequestFilter.serverUrl(req);
}

/**
* @param out
* @param html
* @param config
* @param req
* @return
*/
public static String snoop(PrintWriter out, boolean html, ServletConfig config, HttpServletRequest req)
{
// if no out, send to system out
Expand Down Expand Up @@ -544,7 +553,7 @@ protected static final String toHex(byte b)
**
** This method require inclusion of the javamail mail package.
** @deprecated It is now possible to specify encoded filenames for the browser
** see @link{Web#buildContentDisposition}
** see {@link Web#buildContentDisposition}
**/
public static String encodeFileName(HttpServletRequest req, String fileName )
{
Expand Down
4 changes: 3 additions & 1 deletion master/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,9 @@
<link>http://junit.sourceforge.net/javadoc/</link>
<link>http://commons.apache.org/proper/commons-lang/javadocs/api-release/</link>
<link>http://commons.apache.org/proper/commons-collections/apidocs/</link>
<link>https://commons.apache.org/proper/commons-io/javadocs/api-release/index.html</link>
<link>https://commons.apache.org/proper/commons-io/javadocs/api-release/</link>
<link>https://commons.apache.org/proper/commons-text/javadocs/api-release/</link>
<link>https://commons.apache.org/proper/commons-validator/apidocs</link>
</links>
<breakiterator>true</breakiterator>
<minmemory>256m</minmemory>
Expand Down

0 comments on commit aabf811

Please sign in to comment.