|
From: <me...@us...> - 2010-01-20 15:14:03
|
Revision: 1692
http://openutils.svn.sourceforge.net/openutils/?rev=1692&view=rev
Author: memila
Date: 2010-01-20 15:13:49 +0000 (Wed, 20 Jan 2010)
Log Message:
-----------
added more documentation to tld doc and fix @param in java file
Modified Paths:
--------------
trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java
trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld
Modified: trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java
===================================================================
--- trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2010-01-20 14:48:04 UTC (rev 1691)
+++ trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2010-01-20 15:13:49 UTC (rev 1692)
@@ -65,8 +65,8 @@
/**
* Escapes a javascript string. If "true" is passed as parameter, the string is between ", if false is between '
- * @param String text - the string to be escaped
- * @param boolean dbl - If "true" the escaped string is returned between ", if false is returned between '
+ * @param text the string to be escaped
+ * @param dbl If "true" the escaped string is returned between ", if false is returned between '
* @return the escaped string between either ' or "
*/
public static String escapeJsText(String text, boolean dbl)
@@ -78,9 +78,9 @@
/**
* Crops a String to a given length, adding a suffix if needed.
- * @param java.lang.String value- The string to be adapted
- * @param int maxLength - The number of chars of the string to be kept
- * @param java.lang.String ellipses - The suffix to be added if the string is not complete
+ * @param value The string to be adapted
+ * @param maxLength The number of chars of the string to be kept
+ * @param ellipses The suffix to be added if the string is not complete
* @return adapted String
*/
public static String adaptStringLength(String value, int maxLength, String ellipses)
@@ -95,7 +95,7 @@
/**
* Strip any html tag from a String.
- * @param java.lang.String - The string to be stripped
+ * @param string string The string to be stripped
* @return stripped String
*/
public static String stripHtmlTags(String string)
@@ -130,8 +130,8 @@
/**
* Tests if this string ends with the specified suffix.
- * @param string
- * @param suffix
+ * @param string string to evaluate
+ * @param suffix suffix to be added
* @return true if the string ends with the suffix, false otherwise
*/
public static boolean endsWith(String string, String suffix)
@@ -201,10 +201,10 @@
/**
* Shorten a text with a number of lines and a number of chars per line to be displayed. Display optional ellipses
* where the line is shortened.
- * @param String text original text
- * @param int lines number of lines
- * @param int numOfCharsPerLine number of chars per line
- * @param String ellipses optional ellipses ('...') to display optional ellipses where the line is shortened.
+ * @param text original text
+ * @param lines number of lines
+ * @param numOfCharsPerLine number of chars per line
+ * @param ellipses optional ellipses ('...') to display optional ellipses where the line is shortened.
* @return cropped string
*/
public static String shorten(String text, int lines, int numOfCharsPerLine, String ellipses)
@@ -227,7 +227,11 @@
? StringUtils.substring(wrapped, 0, j) + (ellipses == null ? StringUtils.EMPTY : ellipses)
: text;
}
-
+ /**
+ * Enconde a url in UTF-8 format
+ * @param string url to be encoded
+ * @return a url UTF-8 encoded
+ */
public static String urlencode(String string)
{
try
@@ -240,7 +244,11 @@
return string;
}
}
-
+ /**
+ * Decode a url in UTF-8 format
+ * @param string url to be decoded
+ * @return a url UTF-8 decoded
+ */
public static String urldecode(String string)
{
try
Modified: trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld
===================================================================
--- trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld 2010-01-20 14:48:04 UTC (rev 1691)
+++ trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld 2010-01-20 15:13:49 UTC (rev 1692)
@@ -13,13 +13,21 @@
<function-signature>java.lang.String capitaliseAllWords(java.lang.String)</function-signature>
</function>
<function>
- <description>Gets the substring after the last occurrence of a separator. The separator is not returned.</description>
+ <description>Gets the substring after the last occurrence of a separator. The separator is not returned. The function accept 2 parameters:<![CDATA[
+ <br/>
+ <strong>java.lang.String: </strong>the String to get a substring from, may be null<br/>
+ <strong>java.lang.String: </strong>the String to search for, may be null<br/>
+ ]]></description>
<name>substringAfterLast</name>
<function-class>org.apache.commons.lang.StringUtils</function-class>
<function-signature>java.lang.String substringAfterLast(java.lang.String, java.lang.String)</function-signature>
</function>
<function>
- <description>Gets the substring before the last occurrence of a separator. The separator is not returned.</description>
+ <description>Gets the substring before the last occurrence of a separator. The separator is not returned. The function accept 2 parameters:<![CDATA[
+ <br/>
+ <strong>java.lang.String: </strong>the String to get a substring from, may be null<br/>
+ <strong>java.lang.String: </strong>the String to search for, may be null<br/>
+ ]]></description>
<name>substringBeforeLast</name>
<function-class>org.apache.commons.lang.StringUtils</function-class>
<function-signature>java.lang.String substringBeforeLast(java.lang.String, java.lang.String)</function-signature>
@@ -79,9 +87,9 @@
</function>
<function>
<description>Crops a String to a given length, adding a suffix (for example "...") if needed. The function accept 3 parameters:
- <![CDATA[<br/><strong>java.lang.String:</strong> The string to be adapted<br/>
- <strong>int:</strong> The number of chars of the string to be kept<br/>
- <strong>java.lang.String:</strong> The suffix to be added if the string is not complete
+ <![CDATA[<br/><strong>java.lang.String:</strong> the string to be adapted<br/>
+ <strong>int:</strong> the number of chars of the string to be kept<br/>
+ <strong>java.lang.String:</strong> the suffix to be added if the string is not complete
]]></description>
<name>adaptStringLength</name>
<function-class>net.sourceforge.openutils.elfunctions.ElStringUtils</function-class>
@@ -117,20 +125,35 @@
<function-signature>java.lang.String strip(java.lang.String)</function-signature>
</function>
<function>
- <description>Returns either the passed in String, or if the String is empty or null, the value of defaultStr</description>
+ <description>Returns either the passed in String, or if the String is empty or null, the value of defaultStr. The function accept 2 parameters:<![CDATA[
+ <br/>
+ <strong>java.lang.String: </strong>the String to check, may be null<br/>
+ <strong>java.lang.String: </strong>the default String to return if the string to check is null of empty<br/>
+ ]]></description>
<name>defaultIfEmpty</name>
<function-class>org.apache.commons.lang.StringUtils</function-class>
<function-signature>java.lang.String defaultIfEmpty(java.lang.String, java.lang.String)</function-signature>
</function>
<function>
- <description>A wrapper around java.lang.String#endsWith(..). Tests if this string ends with the specified suffix.</description>
+ <description>A wrapper around java.lang.String#endsWith(..). Tests if this string ends with the specified suffix. The function accept 2 parameters:<![CDATA[
+ <br/>
+ <strong>java.lang.String: </strong>string to evaluate<br/>
+ <strong>java.lang.String: </strong>suffix<br/>
+ ]]></description>
<name>endsWith</name>
<function-class>net.sourceforge.openutils.elfunctions.ElStringUtils</function-class>
<function-signature>boolean endsWith(java.lang.String, java.lang.String)</function-signature>
</function>
<function>
<name>shorten</name>
- <description>Shorten a text with a number of lines and a number of chars per line to be displayed. Display ellipses the line is shortened.</description>
+ <description>Shorten a text with a number of lines and a number of chars per line to be displayed. Display ellipses the line is shortened. The function accept 4 parameters:
+ <![CDATA[
+ <br/>
+ <strong>java.lang.String: </strong>original text<br/>
+ <strong>int: </strong>number of lines<br/>
+ <strong>int: </strong>number of chars per line
+ <strong>java.lang.String: </strong>optional ellipses ('...') to display optional ellipses where the line is shortened.
+ ]]></description>
<function-class>net.sourceforge.openutils.elfunctions.ElStringUtils</function-class>
<function-signature>java.lang.String shorten(java.lang.String, int, int, java.lang.String)</function-signature>
</function>
@@ -160,11 +183,13 @@
</function>
<function>
<name>urlencode</name>
+ <description>Enconde a url in UTF-8 format</description>
<function-class>net.sourceforge.openutils.elfunctions.ElStringUtils</function-class>
<function-signature>java.lang.String urlencode(java.lang.String)</function-signature>
</function>
<function>
<name>urldecode</name>
+ <description>Decode a url in UTF-8 format</description>
<function-class>net.sourceforge.openutils.elfunctions.ElStringUtils</function-class>
<function-signature>java.lang.String urldecode(java.lang.String)</function-signature>
</function>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|