📄 constantpool.html
字号:
</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="accept(org.apache.bcel.classfile.Visitor)"><!-- --></A><H3>accept</H3><PRE>public void <B>accept</B>(<A HREF="../../../../org/apache/bcel/classfile/Visitor.html">Visitor</A> v)</PRE><DL><DD>Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../../org/apache/bcel/classfile/Node.html#accept(org.apache.bcel.classfile.Visitor)">accept</A></CODE> in interface <CODE><A HREF="../../../../org/apache/bcel/classfile/Node.html">Node</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - Visitor object</DL></DD></DL><HR><A NAME="constantToString(org.apache.bcel.classfile.Constant)"><!-- --></A><H3>constantToString</H3><PRE>public java.lang.String <B>constantToString</B>(<A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A> c) throws java.lang.ClassFormatError</PRE><DL><DD>Resolve constant to a string representation.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>constant</CODE> - Constant to be printed<DT><B>Returns:</B><DD>String representation</DL></DD></DL><HR><A NAME="constantToString(int, byte)"><!-- --></A><H3>constantToString</H3><PRE>public java.lang.String <B>constantToString</B>(int index, byte tag) throws java.lang.ClassFormatError</PRE><DL><DD>Retrieve constant at `index' from constant pool and resolve it to a string representation.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - of constant in constant pool<DD><CODE>tag</CODE> - expected type<DT><B>Returns:</B><DD>String representation</DL></DD></DL><HR><A NAME="dump(java.io.DataOutputStream)"><!-- --></A><H3>dump</H3><PRE>public void <B>dump</B>(java.io.DataOutputStream file) throws java.io.IOException</PRE><DL><DD>Dump constant pool to file stream in binary format.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - Output file stream</DL></DD></DL><HR><A NAME="getConstant(int)"><!-- --></A><H3>getConstant</H3><PRE>public <A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A> <B>getConstant</B>(int index)</PRE><DL><DD>Get constant from constant pool.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - Index in constant pool<DT><B>Returns:</B><DD>Constant value<DT><B>See Also: </B><DD><A HREF="../../../../org/apache/bcel/classfile/Constant.html"><CODE>Constant</CODE></A></DL></DD></DL><HR><A NAME="getConstant(int, byte)"><!-- --></A><H3>getConstant</H3><PRE>public <A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A> <B>getConstant</B>(int index, byte tag) throws java.lang.ClassFormatError</PRE><DL><DD>Get constant from constant pool and check whether it has the expected type.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - Index in constant pool<DD><CODE>tag</CODE> - Tag of expected constant, i.e., its type<DT><B>Returns:</B><DD>Constant value<DT><B>See Also: </B><DD><A HREF="../../../../org/apache/bcel/classfile/Constant.html"><CODE>Constant</CODE></A></DL></DD></DL><HR><A NAME="getConstantPool()"><!-- --></A><H3>getConstantPool</H3><PRE>public <A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A>[] <B>getConstantPool</B>()</PRE><DL><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>Array of constants.<DT><B>See Also: </B><DD><A HREF="../../../../org/apache/bcel/classfile/Constant.html"><CODE>Constant</CODE></A></DL></DD></DL><HR><A NAME="getConstantString(int, byte)"><!-- --></A><H3>getConstantString</H3><PRE>public java.lang.String <B>getConstantString</B>(int index, byte tag) throws java.lang.ClassFormatError</PRE><DL><DD>Get string from constant pool and bypass the indirection of `ConstantClass' and `ConstantString' objects. I.e. these classes have an index field that points to another entry of the constant pool of type `ConstantUtf8' which contains the real data.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - Index in constant pool<DD><CODE>tag</CODE> - Tag of expected constant, either ConstantClass or ConstantString<DT><B>Returns:</B><DD>Contents of string reference<DT><B>See Also: </B><DD><A HREF="../../../../org/apache/bcel/classfile/ConstantClass.html"><CODE>ConstantClass</CODE></A>, <A HREF="../../../../org/apache/bcel/classfile/ConstantString.html"><CODE>ConstantString</CODE></A></DL></DD></DL><HR><A NAME="getLength()"><!-- --></A><H3>getLength</H3><PRE>public int <B>getLength</B>()</PRE><DL><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>Length of constant pool.</DL></DD></DL><HR><A NAME="setConstant(int, org.apache.bcel.classfile.Constant)"><!-- --></A><H3>setConstant</H3><PRE>public void <B>setConstant</B>(int index, <A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A> constant)</PRE><DL><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>constant</CODE> - Constant to set</DL></DD></DL><HR><A NAME="setConstantPool(org.apache.bcel.classfile.Constant[])"><!-- --></A><H3>setConstantPool</H3><PRE>public void <B>setConstantPool</B>(<A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A>[] constant_pool)</PRE><DL><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>constant_pool</CODE> - </DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>String representation.</DL></DD></DL><HR><A NAME="copy()"><!-- --></A><H3>copy</H3><PRE>public <A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html">ConstantPool</A> <B>copy</B>()</PRE><DL><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>deep copy of this constant pool</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/ConstantPool.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/classfile/ConstantNameAndType.html"><B>PREV CLASS</B></A> <A HREF="../../../../org/apache/bcel/classfile/ConstantString.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="ConstantPool.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | 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 + -