📄 instructionfinder.html
字号:
<TD><CODE><B><A HREF="../../../../org/apache/bcel/util/InstructionFinder.html#search(java.lang.String, org.apache.bcel.generic.InstructionHandle, org.apache.bcel.util.InstructionFinder.CodeConstraint)">search</A></B>(java.lang.String pattern, <A HREF="../../../../org/apache/bcel/generic/InstructionHandle.html">InstructionHandle</A> from, <A HREF="../../../../org/apache/bcel/util/InstructionFinder.CodeConstraint.html">InstructionFinder.CodeConstraint</A> constraint)</CODE><BR> Search for the given pattern in the instruction list.</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="InstructionFinder(org.apache.bcel.generic.InstructionList)"><!-- --></A><H3>InstructionFinder</H3><PRE>public <B>InstructionFinder</B>(<A HREF="../../../../org/apache/bcel/generic/InstructionList.html">InstructionList</A> il)</PRE><DL><DD><DL><DT><B>Parameters:</B><DD><CODE>il</CODE> - instruction list to search for given patterns</DL></DD></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="reread()"><!-- --></A><H3>reread</H3><PRE>public final void <B>reread</B>()</PRE><DL><DD>Reread the instruction list, e.g., after you've altered the list upon a match.</DL><HR><A NAME="search(java.lang.String, org.apache.bcel.generic.InstructionHandle, org.apache.bcel.util.InstructionFinder.CodeConstraint)"><!-- --></A><H3>search</H3><PRE>public final java.util.Iterator <B>search</B>(java.lang.String pattern, <A HREF="../../../../org/apache/bcel/generic/InstructionHandle.html">InstructionHandle</A> from, <A HREF="../../../../org/apache/bcel/util/InstructionFinder.CodeConstraint.html">InstructionFinder.CodeConstraint</A> constraint)</PRE><DL><DD>Search for the given pattern in the instruction list. You can search for any valid opcode via its symbolic name, e.g. "istore". You can also use a super class or an interface name to match a whole set of instructions, e.g. "BranchInstruction" or "LoadInstruction". "istore" is also an alias for all "istore_x" instructions. Additional aliases are "if" for "ifxx", "if_icmp" for "if_icmpxx", "if_acmp" for "if_acmpxx". Consecutive instruction names must be separated by white space which will be removed during the compilation of the pattern. For the rest the usual pattern matching rules for regular expressions apply.<P> Example pattern: <pre>search("BranchInstruction NOP ((IfInstruction|GOTO)+ ISTORE Instruction)*"); </pre> <p>If you alter the instruction list upon a match such that other matching areas are affected, you should call reread() to update the finder and call search() again, because the matches are cached.<DD><DL><DT><B>Parameters:</B><DD><CODE>pattern</CODE> - the instruction pattern to search for, where case is ignored<DD><CODE>from</CODE> - where to start the search in the instruction list<DD><CODE>constraint</CODE> - optional CodeConstraint to check the found code pattern for user-defined constraints<DT><B>Returns:</B><DD>iterator of matches where e.nextElement() returns an array of instruction handles describing the matched area</DL></DD></DL><HR><A NAME="search(java.lang.String)"><!-- --></A><H3>search</H3><PRE>public final java.util.Iterator <B>search</B>(java.lang.String pattern)</PRE><DL><DD>Start search beginning from the start of the given instruction list.<DD><DL><DT><B>Parameters:</B><DD><CODE>pattern</CODE> - the instruction pattern to search for, where case is ignored<DT><B>Returns:</B><DD>iterator of matches where e.nextElement() returns an array of instruction handles describing the matched area</DL></DD></DL><HR><A NAME="search(java.lang.String, org.apache.bcel.generic.InstructionHandle)"><!-- --></A><H3>search</H3><PRE>public final java.util.Iterator <B>search</B>(java.lang.String pattern, <A HREF="../../../../org/apache/bcel/generic/InstructionHandle.html">InstructionHandle</A> from)</PRE><DL><DD>Start search beginning from `from'.<DD><DL><DT><B>Parameters:</B><DD><CODE>pattern</CODE> - the instruction pattern to search for, where case is ignored<DD><CODE>from</CODE> - where to start the search in the instruction list<DT><B>Returns:</B><DD>iterator of matches where e.nextElement() returns an array of instruction handles describing the matched area</DL></DD></DL><HR><A NAME="search(java.lang.String, org.apache.bcel.util.InstructionFinder.CodeConstraint)"><!-- --></A><H3>search</H3><PRE>public final java.util.Iterator <B>search</B>(java.lang.String pattern, <A HREF="../../../../org/apache/bcel/util/InstructionFinder.CodeConstraint.html">InstructionFinder.CodeConstraint</A> constraint)</PRE><DL><DD>Start search beginning from the start of the given instruction list. Check found matches with the constraint object.<DD><DL><DT><B>Parameters:</B><DD><CODE>pattern</CODE> - the instruction pattern to search for, case is ignored<DD><CODE>constraint</CODE> - constraints to be checked on matching code<DT><B>Returns:</B><DD>instruction handle or `null' if the match failed</DL></DD></DL><HR><A NAME="getInstructionList()"><!-- --></A><H3>getInstructionList</H3><PRE>public final <A HREF="../../../../org/apache/bcel/generic/InstructionList.html">InstructionList</A> <B>getInstructionList</B>()</PRE><DL><DD><DL><DT><B>Returns:</B><DD>the inquired instruction list</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/InstructionFinder.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/bcel/util/ClassVector.html"><B>PREV CLASS</B></A> <A HREF="../../../../org/apache/bcel/util/JavaWrapper.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="InstructionFinder.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#inner_class_summary">INNER</A> | 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></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -