| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"> |
| <!--NewPage--> |
| <HTML> |
| <HEAD> |
| <!-- Generated by javadoc on Wed Apr 14 08:26:35 EDT 2004 --> |
| <TITLE> |
| Velocity 1.4 API: Class StringUtils |
| </TITLE> |
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> |
| </HEAD> |
| <BODY BGCOLOR="white"> |
| |
| <!-- ========== START OF NAVBAR ========== --> |
| <A NAME="navbar_top"><!-- --></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/StringUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../org/apache/velocity/util/SimplePool.html"><B>PREV CLASS</B></A> |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> |
| <A HREF="StringUtils.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <!-- =========== END OF NAVBAR =========== --> |
| |
| <HR> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <H2> |
| <FONT SIZE="-1"> |
| org.apache.velocity.util</FONT> |
| <BR> |
| Class StringUtils</H2> |
| <PRE> |
| java.lang.Object |
| | |
| +--<B>org.apache.velocity.util.StringUtils</B> |
| </PRE> |
| <HR> |
| <DL> |
| <DT>public class <B>StringUtils</B><DT>extends java.lang.Object</DL> |
| |
| <P> |
| This class provides some methods for dynamically |
| invoking methods in objects, and some string |
| manipulation methods used by torque. The string |
| methods will soon be moved into the turbine |
| string utilities class. |
| <P> |
| <DL> |
| <DT><B>Version: </B><DD>$Id: StringUtils.java,v 1.16.8.1 2004/03/03 23:23:07 geirm Exp $</DD> |
| <DT><B>Author: </B><DD><a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>, <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a></DD> |
| </DL> |
| <HR> |
| |
| <P> |
| <!-- ======== INNER CLASS SUMMARY ======== --> |
| |
| |
| <!-- =========== FIELD SUMMARY =========== --> |
| |
| <A NAME="field_summary"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TD COLSPAN=2><FONT SIZE="+2"> |
| <B>Field Summary</B></FONT></TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>private static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#EOL">EOL</A></B></CODE> |
| |
| <BR> |
| Line separator for the OS we are operating on.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>private static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#EOL_LENGTH">EOL_LENGTH</A></B></CODE> |
| |
| <BR> |
| Length of the line separator.</TD> |
| </TR> |
| </TABLE> |
| |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| |
| <A NAME="constructor_summary"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TD COLSPAN=2><FONT SIZE="+2"> |
| <B>Constructor Summary</B></FONT></TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#StringUtils()">StringUtils</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| </TABLE> |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| |
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TD COLSPAN=2><FONT SIZE="+2"> |
| <B>Method Summary</B></FONT></TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#allEmpty(java.util.List)">allEmpty</A></B>(java.util.List list)</CODE> |
| |
| <BR> |
| Check to see if all the string objects passed |
| in are empty.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#capitalizeFirstLetter(java.lang.String)">capitalizeFirstLetter</A></B>(java.lang.String data)</CODE> |
| |
| <BR> |
| |
| Capitalize the first letter but leave the rest as they are.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#chop(java.lang.String, int)">chop</A></B>(java.lang.String s, |
| int i)</CODE> |
| |
| <BR> |
| Chop i characters off the end of a string.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#chop(java.lang.String, int, java.lang.String)">chop</A></B>(java.lang.String s, |
| int i, |
| java.lang.String eol)</CODE> |
| |
| <BR> |
| Chop i characters off the end of a string.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#collapseNewlines(java.lang.String)">collapseNewlines</A></B>(java.lang.String argStr)</CODE> |
| |
| <BR> |
| Remove/collapse multiple newline characters.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#collapseSpaces(java.lang.String)">collapseSpaces</A></B>(java.lang.String argStr)</CODE> |
| |
| <BR> |
| Remove/collapse multiple spaces.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#concat(java.util.List)">concat</A></B>(java.util.List list)</CODE> |
| |
| <BR> |
| Concatenates a list of objects as a String.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#fileContentsToString(java.lang.String)">fileContentsToString</A></B>(java.lang.String file)</CODE> |
| |
| <BR> |
| Read the contents of a file and place them in |
| a string object.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#firstLetterCaps(java.lang.String)">firstLetterCaps</A></B>(java.lang.String data)</CODE> |
| |
| <BR> |
| |
| Makes the first letter caps and the rest lowercase.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#getPackageAsPath(java.lang.String)">getPackageAsPath</A></B>(java.lang.String pckge)</CODE> |
| |
| <BR> |
| Return a package name as a relative path name</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#normalizePath(java.lang.String)">normalizePath</A></B>(java.lang.String path)</CODE> |
| |
| <BR> |
| Return a context-relative path, beginning with a "/", that represents |
| the canonical version of the specified path after ".." and "." elements |
| are resolved out.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#removeAndHump(java.lang.String)">removeAndHump</A></B>(java.lang.String data)</CODE> |
| |
| <BR> |
| |
| 'Camels Hump' replacement of underscores.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#removeAndHump(java.lang.String, java.lang.String)">removeAndHump</A></B>(java.lang.String data, |
| java.lang.String replaceThis)</CODE> |
| |
| <BR> |
| |
| 'Camels Hump' replacement.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#removeUnderScores(java.lang.String)">removeUnderScores</A></B>(java.lang.String data)</CODE> |
| |
| <BR> |
| <B>Deprecated.</B> <I>Use the org.apache.commons.util.StringUtils class |
| instead. Using its firstLetterCaps() method in conjunction |
| with a StringTokenizer will achieve the same result.</I></TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#select(boolean, java.lang.String, java.lang.String)">select</A></B>(boolean state, |
| java.lang.String trueString, |
| java.lang.String falseString)</CODE> |
| |
| <BR> |
| If state is true then return the trueString, else |
| return the falseString.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String[]</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#split(java.lang.String, java.lang.String)">split</A></B>(java.lang.String line, |
| java.lang.String delim)</CODE> |
| |
| <BR> |
| Create a string array from a string separated by delim</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#stackTrace(java.lang.Throwable)">stackTrace</A></B>(java.lang.Throwable e)</CODE> |
| |
| <BR> |
| Returns the output of printStackTrace as a String.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.StringBuffer</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#stringSubstitution(java.lang.String, java.util.Hashtable)">stringSubstitution</A></B>(java.lang.String argStr, |
| java.util.Hashtable vars)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.StringBuffer</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#stringSubstitution(java.lang.String, java.util.Map)">stringSubstitution</A></B>(java.lang.String argStr, |
| java.util.Map vars)</CODE> |
| |
| <BR> |
| Perform a series of substitutions.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/velocity/util/StringUtils.html#sub(java.lang.String, java.lang.String, java.lang.String)">sub</A></B>(java.lang.String line, |
| java.lang.String oldString, |
| java.lang.String newString)</CODE> |
| |
| <BR> |
| Replaces all instances of oldString with newString in line.</TD> |
| </TR> |
| </TABLE> |
| <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <TD><B>Methods inherited from class java.lang.Object</B></TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><clinit>, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait</CODE></TD> |
| </TR> |
| </TABLE> |
| |
| <P> |
| |
| <!-- ============ FIELD DETAIL =========== --> |
| |
| <A NAME="field_detail"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TD COLSPAN=1><FONT SIZE="+2"> |
| <B>Field Detail</B></FONT></TD> |
| </TR> |
| </TABLE> |
| |
| <A NAME="EOL"><!-- --></A><H3> |
| EOL</H3> |
| <PRE> |
| private static final java.lang.String <B>EOL</B></PRE> |
| <DL> |
| <DD>Line separator for the OS we are operating on.</DL> |
| <HR> |
| |
| <A NAME="EOL_LENGTH"><!-- --></A><H3> |
| EOL_LENGTH</H3> |
| <PRE> |
| private static final int <B>EOL_LENGTH</B></PRE> |
| <DL> |
| <DD>Length of the line separator.</DL> |
| |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| |
| <A NAME="constructor_detail"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TD COLSPAN=1><FONT SIZE="+2"> |
| <B>Constructor Detail</B></FONT></TD> |
| </TR> |
| </TABLE> |
| |
| <A NAME="StringUtils()"><!-- --></A><H3> |
| StringUtils</H3> |
| <PRE> |
| public <B>StringUtils</B>()</PRE> |
| <DL> |
| </DL> |
| |
| <!-- ============ METHOD DETAIL ========== --> |
| |
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TD COLSPAN=1><FONT SIZE="+2"> |
| <B>Method Detail</B></FONT></TD> |
| </TR> |
| </TABLE> |
| |
| <A NAME="concat(java.util.List)"><!-- --></A><H3> |
| concat</H3> |
| <PRE> |
| public java.lang.String <B>concat</B>(java.util.List list)</PRE> |
| <DL> |
| <DD>Concatenates a list of objects as a String.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>list</CODE> - The list of objects to concatenate.<DT><B>Returns:</B><DD>A text representation of the concatenated objects.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getPackageAsPath(java.lang.String)"><!-- --></A><H3> |
| getPackageAsPath</H3> |
| <PRE> |
| public static java.lang.String <B>getPackageAsPath</B>(java.lang.String pckge)</PRE> |
| <DL> |
| <DD>Return a package name as a relative path name<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>String</CODE> - package name to convert to a directory.<DT><B>Returns:</B><DD>String directory path.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="removeUnderScores(java.lang.String)"><!-- --></A><H3> |
| removeUnderScores</H3> |
| <PRE> |
| public static java.lang.String <B>removeUnderScores</B>(java.lang.String data)</PRE> |
| <DL> |
| <DD><B>Deprecated.</B> <I>Use the org.apache.commons.util.StringUtils class |
| instead. Using its firstLetterCaps() method in conjunction |
| with a StringTokenizer will achieve the same result.</I> |
| <P> |
| <DD><p> |
| Remove underscores from a string and replaces first |
| letters with capitals. Other letters are changed to lower case. |
| </p> |
| |
| <p> |
| For example <code>foo_bar</code> becomes <code>FooBar</code> |
| but <code>foo_barBar</code> becomes <code>FooBarbar</code>. |
| </p><DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>data</CODE> - string to remove underscores from.<DT><B>Returns:</B><DD>String</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="removeAndHump(java.lang.String)"><!-- --></A><H3> |
| removeAndHump</H3> |
| <PRE> |
| public static java.lang.String <B>removeAndHump</B>(java.lang.String data)</PRE> |
| <DL> |
| <DD><p> |
| 'Camels Hump' replacement of underscores. |
| </p> |
| |
| <p> |
| Remove underscores from a string but leave the capitalization of the |
| other letters unchanged. |
| </p> |
| |
| <p> |
| For example <code>foo_barBar</code> becomes <code>FooBarBar</code>. |
| </p><DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>data</CODE> - string to hump<DT><B>Returns:</B><DD>String</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="removeAndHump(java.lang.String, java.lang.String)"><!-- --></A><H3> |
| removeAndHump</H3> |
| <PRE> |
| public static java.lang.String <B>removeAndHump</B>(java.lang.String data, |
| java.lang.String replaceThis)</PRE> |
| <DL> |
| <DD><p> |
| 'Camels Hump' replacement. |
| </p> |
| |
| <p> |
| Remove one string from another string but leave the capitalization of the |
| other letters unchanged. |
| </p> |
| |
| <p> |
| For example, removing "_" from <code>foo_barBar</code> becomes <code>FooBarBar</code>. |
| </p><DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>data</CODE> - string to hump<DD><CODE>replaceThis</CODE> - string to be replaced<DT><B>Returns:</B><DD>String</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="firstLetterCaps(java.lang.String)"><!-- --></A><H3> |
| firstLetterCaps</H3> |
| <PRE> |
| public static java.lang.String <B>firstLetterCaps</B>(java.lang.String data)</PRE> |
| <DL> |
| <DD><p> |
| Makes the first letter caps and the rest lowercase. |
| </p> |
| |
| <p> |
| For example <code>fooBar</code> becomes <code>Foobar</code>. |
| </p><DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>data</CODE> - capitalize this<DT><B>Returns:</B><DD>String</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="capitalizeFirstLetter(java.lang.String)"><!-- --></A><H3> |
| capitalizeFirstLetter</H3> |
| <PRE> |
| public static java.lang.String <B>capitalizeFirstLetter</B>(java.lang.String data)</PRE> |
| <DL> |
| <DD><p> |
| Capitalize the first letter but leave the rest as they are. |
| </p> |
| |
| <p> |
| For example <code>fooBar</code> becomes <code>FooBar</code>. |
| </p><DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>data</CODE> - capitalize this<DT><B>Returns:</B><DD>String</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="split(java.lang.String, java.lang.String)"><!-- --></A><H3> |
| split</H3> |
| <PRE> |
| public static java.lang.String[] <B>split</B>(java.lang.String line, |
| java.lang.String delim)</PRE> |
| <DL> |
| <DD>Create a string array from a string separated by delim<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>line</CODE> - the line to split<DD><CODE>delim</CODE> - the delimter to split by<DT><B>Returns:</B><DD>a string array of the split fields</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="chop(java.lang.String, int)"><!-- --></A><H3> |
| chop</H3> |
| <PRE> |
| public static java.lang.String <B>chop</B>(java.lang.String s, |
| int i)</PRE> |
| <DL> |
| <DD>Chop i characters off the end of a string. |
| This method assumes that any EOL characters in String s |
| and the platform EOL will be the same. |
| A 2 character EOL will count as 1 character.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>string</CODE> - String to chop.<DD><CODE>i</CODE> - Number of characters to chop.<DT><B>Returns:</B><DD>String with processed answer.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="chop(java.lang.String, int, java.lang.String)"><!-- --></A><H3> |
| chop</H3> |
| <PRE> |
| public static java.lang.String <B>chop</B>(java.lang.String s, |
| int i, |
| java.lang.String eol)</PRE> |
| <DL> |
| <DD>Chop i characters off the end of a string. |
| A 2 character EOL will count as 1 character.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>string</CODE> - String to chop.<DD><CODE>i</CODE> - Number of characters to chop.<DD><CODE>eol</CODE> - A String representing the EOL (end of line).<DT><B>Returns:</B><DD>String with processed answer.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="stringSubstitution(java.lang.String, java.util.Hashtable)"><!-- --></A><H3> |
| stringSubstitution</H3> |
| <PRE> |
| public static java.lang.StringBuffer <B>stringSubstitution</B>(java.lang.String argStr, |
| java.util.Hashtable vars)</PRE> |
| <DL> |
| </DL> |
| <HR> |
| |
| <A NAME="stringSubstitution(java.lang.String, java.util.Map)"><!-- --></A><H3> |
| stringSubstitution</H3> |
| <PRE> |
| public static java.lang.StringBuffer <B>stringSubstitution</B>(java.lang.String argStr, |
| java.util.Map vars)</PRE> |
| <DL> |
| <DD>Perform a series of substitutions. The substitions |
| are performed by replacing $variable in the target |
| string with the value of provided by the key "variable" |
| in the provided hashtable.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>String</CODE> - target string<DD><CODE>Hashtable</CODE> - name/value pairs used for substitution<DT><B>Returns:</B><DD>String target string with replacements.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="fileContentsToString(java.lang.String)"><!-- --></A><H3> |
| fileContentsToString</H3> |
| <PRE> |
| public static java.lang.String <B>fileContentsToString</B>(java.lang.String file)</PRE> |
| <DL> |
| <DD>Read the contents of a file and place them in |
| a string object.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>String</CODE> - path to file.<DT><B>Returns:</B><DD>String contents of the file.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="collapseNewlines(java.lang.String)"><!-- --></A><H3> |
| collapseNewlines</H3> |
| <PRE> |
| public static java.lang.String <B>collapseNewlines</B>(java.lang.String argStr)</PRE> |
| <DL> |
| <DD>Remove/collapse multiple newline characters.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>String</CODE> - string to collapse newlines in.<DT><B>Returns:</B><DD>String</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="collapseSpaces(java.lang.String)"><!-- --></A><H3> |
| collapseSpaces</H3> |
| <PRE> |
| public static java.lang.String <B>collapseSpaces</B>(java.lang.String argStr)</PRE> |
| <DL> |
| <DD>Remove/collapse multiple spaces.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>String</CODE> - string to remove multiple spaces from.<DT><B>Returns:</B><DD>String</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="sub(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3> |
| sub</H3> |
| <PRE> |
| public static final java.lang.String <B>sub</B>(java.lang.String line, |
| java.lang.String oldString, |
| java.lang.String newString)</PRE> |
| <DL> |
| <DD>Replaces all instances of oldString with newString in line. |
| Taken from the Jive forum package.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>String</CODE> - original string.<DD><CODE>String</CODE> - string in line to replace.<DD><CODE>String</CODE> - replace oldString with this.<DT><B>Returns:</B><DD>String string with replacements.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="stackTrace(java.lang.Throwable)"><!-- --></A><H3> |
| stackTrace</H3> |
| <PRE> |
| public static final java.lang.String <B>stackTrace</B>(java.lang.Throwable e)</PRE> |
| <DL> |
| <DD>Returns the output of printStackTrace as a String.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>e</CODE> - A Throwable.<DT><B>Returns:</B><DD>A String.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="normalizePath(java.lang.String)"><!-- --></A><H3> |
| normalizePath</H3> |
| <PRE> |
| public static final java.lang.String <B>normalizePath</B>(java.lang.String path)</PRE> |
| <DL> |
| <DD>Return a context-relative path, beginning with a "/", that represents |
| the canonical version of the specified path after ".." and "." elements |
| are resolved out. If the specified path attempts to go outside the |
| boundaries of the current context (i.e. too many ".." path elements |
| are present), return <code>null</code> instead.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>path</CODE> - Path to be normalized<DT><B>Returns:</B><DD>String normalized path</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="select(boolean, java.lang.String, java.lang.String)"><!-- --></A><H3> |
| select</H3> |
| <PRE> |
| public java.lang.String <B>select</B>(boolean state, |
| java.lang.String trueString, |
| java.lang.String falseString)</PRE> |
| <DL> |
| <DD>If state is true then return the trueString, else |
| return the falseString.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>boolean</CODE> - <DD><CODE>String</CODE> - trueString<DD><CODE>String</CODE> - falseString</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="allEmpty(java.util.List)"><!-- --></A><H3> |
| allEmpty</H3> |
| <PRE> |
| public boolean <B>allEmpty</B>(java.util.List list)</PRE> |
| <DL> |
| <DD>Check to see if all the string objects passed |
| in are empty.<DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>list</CODE> - A list of <CODE>String</CODE> objects.<DT><B>Returns:</B><DD>Whether all strings are empty.</DL> |
| </DD> |
| </DL> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <HR> |
| |
| <!-- ========== START OF NAVBAR ========== --> |
| <A NAME="navbar_bottom"><!-- --></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/StringUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../org/apache/velocity/util/SimplePool.html"><B>PREV CLASS</B></A> |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> |
| <A HREF="StringUtils.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <!-- =========== END OF NAVBAR =========== --> |
| |
| <HR> |
| Copyright © 2002 Apache Software Foundation. All Rights Reserved. |
| </BODY> |
| </HTML> |