📄 scriptcatcher.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Wed Jan 15 11:28:22 CET 2003 --><TITLE>ScriptCatcher</TITLE><META NAME="keywords" CONTENT="javatools.util.ScriptCatcher,ScriptCatcher class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"></HEAD><SCRIPT>function asd(){parent.document.title="ScriptCatcher";}</SCRIPT><BODY BGCOLOR="white" onload="asd();"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=3 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="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="../../javatools/util/Reflect.html"><B>PREV CLASS</B></A> <A HREF="../../javatools/util/StringUtils.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="ScriptCatcher.html" TARGET="_top"><B>NO FRAMES</B></A> <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <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">javatools.util</FONT><BR>Class ScriptCatcher</H2><PRE>java.lang.Object | +--<B>javatools.util.ScriptCatcher</B></PRE><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../javatools/db/util/TableStructureCatcher.html">TableStructureCatcher</A></DD></DL><HR><DL><DT>public class <B>ScriptCatcher</B><DT>extends java.lang.Object</DL><P>It's a class to catch text from a script file and to divide it into commands.<P><P><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== 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="../../javatools/util/ScriptCatcher.html#ScriptCatcher()">ScriptCatcher</A></B>()</CODE><BR> Creates new ScriptCatcher</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> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#addCommand(java.lang.String)">addCommand</A></B>(java.lang.String value)</CODE><BR> Adds a new command.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#clear()">clear</A></B>()</CODE><BR> Removes all the commands.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#constructCommands(java.lang.String)">constructCommands</A></B>(java.lang.String textScript)</CODE><BR> Construct commands fromf a given string (textScript) instead of a file.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.util.ArrayList</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#getCommandList()">getCommandList</A></B>()</CODE><BR> Returns the commands as a list.</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="../../javatools/util/ScriptCatcher.html#getCommands()">getCommands</A></B>()</CODE><BR> Returns the commands as an array.</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="../../javatools/util/ScriptCatcher.html#getCommandText(int)">getCommandText</A></B>(int numCommand)</CODE><BR> Returns the command text of command <CODE>numCommand</CODE>.</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="../../javatools/util/ScriptCatcher.html#getCommentdelimiter()">getCommentdelimiter</A></B>()</CODE><BR> Returns the string who represents the start of a comment.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> char</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#getDivideCommandChar()">getDivideCommandChar</A></B>()</CODE><BR> Returns the character who represents the end of a command.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#getNumCommands()">getNumCommands</A></B>()</CODE><BR> Returns the number of commands.</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="../../javatools/util/ScriptCatcher.html#getRemoveFormat()">getRemoveFormat</A></B>()</CODE><BR> Returns the property about removing formatting items (spaces and new-lines)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.Character</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#getStringDelimiterChar()">getStringDelimiterChar</A></B>()</CODE><BR> Returns the character who represents the start/end of a string in the script.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.util.Iterator</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#iterator()">iterator</A></B>()</CODE><BR> Returns an iterator to iterate commands.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#loadScript(java.lang.String)">loadScript</A></B>(java.lang.String fileName)</CODE><BR> Loads a script whose path is in "fileName" string, divides it into commands and make them available.</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="../../javatools/util/ScriptCatcher.html#removeComments(java.lang.String)">removeComments</A></B>(java.lang.String inStr)</CODE><BR> Removes comments from a script (string inStr).</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="../../javatools/util/ScriptCatcher.html#removeSpaces(java.lang.String)">removeSpaces</A></B>(java.lang.String cmdText)</CODE><BR> Removes unuseful spaces, tabs and CRs from a command. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#saveScript(java.lang.String)">saveScript</A></B>(java.lang.String fileName)</CODE><BR> Saves a script using saved command texts into "fileName".</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#setCommandText(int, java.lang.String)">setCommandText</A></B>(int numCommand, java.lang.String value)</CODE><BR> Sets the text for command <CODE>numCommand</CODE> with the string <CODE>value</CODE>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#setCommentDelimiter(java.lang.String)">setCommentDelimiter</A></B>(java.lang.String inStr)</CODE><BR> Sets the string who represents the start of a comment.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#setDivideCommandChar(char)">setDivideCommandChar</A></B>(char inChar)</CODE><BR> Sets the character who represents the end of a command.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#setNumCommands(int)">setNumCommands</A></B>(int numCommands)</CODE><BR> Sets the number of commands. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#setRemoveFormat(boolean)">setRemoveFormat</A></B>(boolean value)</CODE><BR> Controls whether formatting items (spaces and new-lines) are going to be removed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javatools/util/ScriptCatcher.html#setStringDelimiterChar(java.lang.Character)">setStringDelimiterChar</A></B>(java.lang.Character inChar)</CODE><BR> Sets the character who represents the start/end of a string in the script.</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="../../javatools/util/ScriptCatcher.html#textFile2String(java.lang.String)">textFile2String</A></B>(java.lang.String fileName)</CODE><BR> Loads text file "fileName" and puts its content into a string.</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>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= 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="ScriptCatcher()"><!-- --></A><H3>ScriptCatcher</H3><PRE>public <B>ScriptCatcher</B>()</PRE><DL><DD>Creates new ScriptCatcher<P></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="setRemoveFormat(boolean)"><!-- --></A><H3>setRemoveFormat</H3><PRE>public void <B>setRemoveFormat</B>(boolean value)</PRE><DL><DD>Controls whether formatting items (spaces and new-lines) are going to be removed.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - <CODE>true</CODE>: formatting items will be removed; <CODE>false</CODE>: formatting items will NOT be removed.</DL></DD></DL><HR><A NAME="getRemoveFormat()"><!-- --></A><H3>getRemoveFormat</H3><PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -