📄 jcvm05export.html
字号:
</P><P CLASS="Paragraph"><A NAME="pgfId-7157"></A><KBD CLASS="Filename-Command">interfaces[]</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-999246"></A>If this <KBD CLASS="Filename-Command">class_info</KBD> structure describes a class, the <KBD CLASS="Filename-Command">interfaces</KBD> array contains an entry for each public interface implemented by this class. It does not include package-visible interfaces. It does include all public superinterfaces in the hierarchies of public interfaces implemented by this class.</P><P CLASS="ParaIndent1"><A NAME="pgfId-999362"></A>If this <KBD CLASS="Filename-Command">class_info</KBD> structure describes an interface, the <KBD CLASS="Filename-Command">interfaces</KBD> array contains an entry for each public interface extended by this interface. It does not include package visible interfaces. It does include all public superinterfaces in the hierarchies of public interfaces extended by this interface.</P><P CLASS="ParaIndent1"><A NAME="pgfId-999649"></A>Each value in the <KBD CLASS="Filename-Command">interfaces</KBD> array must be a valid index into the <KBD CLASS="Filename-Command">constant_pool</KBD> table. The <KBD CLASS="Filename-Command">constant_pool</KBD> entry at each value must be a <KBD CLASS="Filename-Command">CONSTANT_Classref_info</KBD> structure (<A HREF="JCVM05export.html#22612" CLASS="XRef">Section 5.6.2, CONSTANT_Classref</A>) representing a valid, fully-qualified Java interface name. Entries in the interfaces array can occur in any order.</P><P CLASS="Paragraph"><A NAME="pgfId-15955"></A><KBD CLASS="Filename-Command">export_fields_count</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7160"></A>The value of the <KBD CLASS="Filename-Command">export_fields_count</KBD> item gives the number of entries in the fields table.</P><P CLASS="Paragraph"><A NAME="pgfId-7161"></A><KBD CLASS="Filename-Command">fields[]</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7162"></A>Each value in the <KBD CLASS="Filename-Command">fields</KBD> table is a variable-length <KBD CLASS="Filename-Command">field_info</KBD> (<A HREF="JCVM05export.html#14672" CLASS="XRef">Section 5.8, Fields</A>) structure. The <KBD CLASS="Filename-Command">field_info</KBD> contains an entry for each publicly accessible field, both class variables and instance variables, declared by this class or interface. It does not include items representing fields that are inherited from superclasses or superinterfaces.</P><P CLASS="Paragraph"><A NAME="pgfId-7163"></A><KBD CLASS="Filename-Command">export_methods_count</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7164"></A>The value of the <KBD CLASS="Filename-Command">export_methods_count</KBD> item gives the number of entries in the <KBD CLASS="Filename-Command">methods</KBD> table.</P><P CLASS="Paragraph"><A NAME="pgfId-7165"></A><KBD CLASS="Filename-Command">methods[]</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7166"></A>Each value in the <KBD CLASS="Filename-Command">methods</KBD> table is a method_info (<A HREF="JCVM05export.html#10802" CLASS="XRef">Section 5.9, Methods</A>) structure. The <KBD CLASS="Filename-Command">method_info</KBD> structure contains an entry for each publicly accessible class (static or constructor) method defined by this class, and each publicly accessible instance method defined by this class or its superclasses, or defined by this interface or its super-interfaces.</P><H2 CLASS="Head1"><A NAME="pgfId-7167"></A><DIV><HR ALIGN=left SIZE=6 WIDTH=15% noshade></DIV>5.8 <A NAME="14672"></A>Fields<A NAME="marker-20712"></A></H2><P CLASS="Paragraph"><A NAME="pgfId-7168"></A>Each field is described by a variable-length <KBD CLASS="Filename-Command">field_info</KBD> structure. The format of this structure is:</P><DIV CLASS="Code"><BR><TABLE CLASS="Code" BORDER=1 BORDERCOLORLIGHT="#FFFFFF" BORDERCOLORDARK="#000000" CELLPADDING=5 CELLSPACING=0 DIR="LTR"><TBODY><TR><TD SCOPE="ROW"><P CLASS="TableTextCode"><A NAME="pgfId-1003189"></A>field_info {</P><P CLASS="TableTextCode"><A NAME="pgfId-1003191"></A> u1 token</P><P CLASS="TableTextCode"><A NAME="pgfId-1003193"></A> u2 access_flags</P><P CLASS="TableTextCode"><A NAME="pgfId-1003195"></A> u2 name_index</P><P CLASS="TableTextCode"><A NAME="pgfId-1003197"></A> u2 descriptor_index</P><P CLASS="TableTextCode"><A NAME="pgfId-1003199"></A> u2 attributes_count</P><P CLASS="TableTextCode"><A NAME="pgfId-1003201"></A> attribute_info attributes[attributes_count]</P><P CLASS="TableTextCode"><A NAME="pgfId-1003203"></A>}</P></TD></TR></TBODY></TABLE><BR></DIV><P CLASS="Paragraph"><A NAME="pgfId-7177"></A>The items of the <KBD CLASS="Filename-Command">field_info structure</KBD> are as follows:</P><P CLASS="Paragraph"><A NAME="pgfId-11179"></A><KBD CLASS="Filename-Command">token</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-11182"></A>The token item is the token assigned to this field. There are three scopes for field tokens: <KBD CLASS="Filename-Command">final static</KBD> fields of primitive types (compile-time constants), all other <KBD CLASS="Filename-Command">static</KBD> fields, and <KBD CLASS="Filename-Command">instance</KBD> fields.</P><P CLASS="ParaIndent1"><A NAME="pgfId-11186"></A>If this field is a compile-time constant, the value of the token item is 0xFF. Compile-time constants are represented in export files, but are not assigned token values suitable for late binding. Instead Java Card Converters must replace bytecodes that reference <KBD CLASS="Filename-Command">final static</KBD> fields with bytecodes that load the constant value of the field.<A NAME="fnote4"></A><A HREF="#pgfId-11656" CLASS="footnote"><SUP>[4]</SUP></A></P><P CLASS="ParaIndent1"><A NAME="pgfId-7180"></A>If this field is <KBD CLASS="Filename-Command">static</KBD>, but is not a compile-time constant, the token item represents a static field token (<A HREF="JCVM04naming.html#32517" CLASS="XRef">Section 4.3.7.3, Static Fields</A>).</P><P CLASS="ParaIndent1"><A NAME="pgfId-11711"></A>If this field is an instance field, the token item represents an instance field token (<A HREF="JCVM04naming.html#30617" CLASS="XRef">Section 4.3.7.5, Instance Fields</A>).</P><P CLASS="Paragraph"><A NAME="pgfId-11712"></A><KBD CLASS="Filename-Command">access_flags</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-998066"></A>The value of the <KBD CLASS="Filename-Command">access_flags</KBD> item is a mask of modifiers used with fields. The <I CLASS="EquationVariables">access_flags</I> modifiers are shown in the following table.</P><BR><TABLE CLASS="Titled" BORDER=1 BORDERCOLORLIGHT="#FFFFFF" BORDERCOLORDARK="#000000" CELLPADDING=5 CELLSPACING=0 DIR="LTR"><CAPTION CLASS="TableCaption"><A NAME="pgfId-998069"> </A> TABLE 5-4 Export File Field Access and Modifier Flags </CAPTION><THEAD><TR><TH SCOPE="COL" ROWSPAN="1" COLSPAN="1" BGCOLOR="#CCCCCC"><P CLASS="TableHead"><A NAME="pgfId-998077"></A>Name</P></TH><TH SCOPE="COL" ROWSPAN="1" COLSPAN="1" BGCOLOR="#CCCCCC"><P CLASS="TableHead"><A NAME="pgfId-998079"></A>Value</P></TH><TH SCOPE="COL" ROWSPAN="1" COLSPAN="1" BGCOLOR="#CCCCCC"><P CLASS="TableHead"><A NAME="pgfId-998081"></A>Meaning</P></TH><TH SCOPE="COL" ROWSPAN="1" COLSPAN="1" BGCOLOR="#CCCCCC"><P CLASS="TableHead"><A NAME="pgfId-998083"></A>Used By</P></TH></TR></THEAD><TBODY><TR><TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-998085"></A>ACC_PUBLIC</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-998087"></A>0x0001</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-998089"></A>Is public; may be accessed from outside its package.</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-998091"></A>Any field</P></TD></TR><TR><TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-998093"></A>ACC_PROTECTED</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-998095"></A>0x0004</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-998097"></A>Is protected; may be accessed within subclasses.</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-998099"></A>Class field</P><P CLASS="TableText"><A NAME="pgfId-998100"></A>Instance field</P></TD></TR><TR><TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-998102"></A>ACC_STATIC</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-998104"></A>0x0008</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-998106"></A>Is static.</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-998108"></A>Class field</P><P CLASS="TableText"><A NAME="pgfId-998109"></A>Interface field</P></TD></TR><TR><TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-998111"></A>ACC_FINAL</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-998113"></A>0x0010</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-998115"></A>Is final; no further overriding or assignment after initialization.</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-998117"></A>Any field</P></TD></TR></TBODY></TABLE><BR><P CLASS="ParaIndent1"><A NAME="pgfId-998118"></A>Field access and modifier flags are defined in the same way and with the same restrictions as described in <I CLASS="Title">The Java Virtual Machine Specification</I>.</P><P CLASS="ParaIndent1"><A NAME="pgfId-18141"></A>Since all fields represented in an export file are either public or protected, exactly one of the <KBD CLASS="Filename-Command">ACC_PUBLIC</KBD> or <KBD CLASS="Filename-Command">ACC_PROTECTED</KBD> flag must be set.</P><P CLASS="ParaIndent1"><A NAME="pgfId-11207"></A>The Java Card virtual machine reserves all other flag values. Their values must be zero.</P><P CLASS="Paragraph"><A NAME="pgfId-7228"></A><KBD CLASS="Filename-Command">name_index</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7229"></A>The value of the <KBD CLASS="Filename-Command">name_index</KBD> item must be a valid index into the <KBD CLASS="Filename-Command">constant_pool</KBD> table. The <KBD CLASS="Filename-Command">constant_pool</KBD> entry at that index must be a <KBD CLASS="Filename-Command">CONSTANT_Utf8_info</KBD> (<A HREF="JCVM05export.html#53940" CLASS="XRef">Section 5.6.4, CONSTANT_Utf8</A>) structure representing a valid Java field name stored as a simple (not fully qualified) name, that is, as a Java identifier.</P><P CLASS="Paragraph"><A NAME="pgfId-7230"></A><KBD CLASS="Filename-Command">descriptor_index</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7231"></A>The value of the <KBD CLASS="Filename-Command">descriptor_index</KBD> item must be a valid index into the <KBD CLASS="Filename-Command">constant_pool</KBD> table. The <KBD CLASS="Filename-Command">constant_pool</KBD> entry at that index must be a <KBD CLASS="Filename-Command">CONSTANT_Utf8_info</KBD> (<A HREF="JCVM05export.html#53940" CLASS="XRef">Section 5.6.4, CONSTANT_Utf8</A>) structure representing a valid Java field descriptor.</P><P CLASS="ParaIndent1"><A NAME="pgfId-7232"></A>Representation of a field descriptor in an <KBD CLASS="Filename-Command">export</KBD> file is the same as in a Java class file. See the specification described in <I CLASS="Title">The Java Virtual Machine Specification</I> (§4.3.2).</P><P CLASS="ParaIndent1"><A NAME="pgfId-17920"></A>If this field is a reference-type, the class referenced must be a public class.</P><P CLASS="Paragraph"><A NAME="pgfId-7233"></A><KBD CLASS="Filename-Command">attributes_count</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7234"></A>The value of the <KBD CLASS="Filename-Command">attributes_count</KBD> item indicates the number of additional attributes of this field. The only <KBD CLASS="Filename-Command">field_info</KBD> attribute currently defined is the <KBD CLASS="Filename-Command">ConstantValue</KBD> attribute (<A HREF="JCVM05export.html#82094" CLASS="XRef">Section 5.10.1, ConstantValue Attribute</A>). For static final fields of primitive types, the value must be <KBD CLASS="Filename-Command">1</KBD>; that is, when both the <KBD CLASS="Filename-Command">ACC_STATIC</KBD> and <KBD CLASS="Filename-Command">ACC_FINAL</KBD> bits in the <KBD CLASS="Filename-Command">flags</KBD> item are set an attribute must be present. For all other fields the value of the <KBD CLASS="Filename-Command">attributes_count</KBD> item must be <KBD CLASS="Filename-Command">0</KBD>.</P><P CLASS="Paragraph"><A NAME="pgfId-7235"></A><KBD CLASS="Filename-Command">attributes[]</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7236"></A>The only attribute defined for the attributes table of a <KBD CLASS="Filename-Command">field_info</KBD> structure by this specification is the ConstantValue attribute (<A HREF="JCVM05export.html#82094" CLASS="XRef">Section 5.10.1, ConstantValue Attribute</A>). This must be defined for static final fields of primitive types (<KBD CLASS="Filename-Command">boolean</KBD>, <KBD CLASS="Filename-Command">byte</KBD>, <KBD CLASS="Filename-Command">short</KBD>, and <KBD CLASS="Filename-Command">int</KBD>).</P><H2 CLASS="Head1"><A NAME="pgfId-7237"></A><DIV><HR ALIGN=left SIZE=6 WIDTH=15% noshade></DIV>5.9 <A NAME="10802"></A>Methods<A NAME="marker-20713"></A></H2><P CLASS="Paragraph"><A NAME="pgfId-7238"></A>Each method is described by a variable-length <KBD CLASS="Filename-Command">method_info</KBD> structure. The format of this structure is:</P><DIV CLASS="Code"><BR><TABLE CLASS="Code" BORDER=1 BORDERCOLORLIGHT="#FFFFFF" BORDERCOLORDARK="#000000" CELLPADDING=5 CELLSPACING=0 DIR="LTR"><TBODY><TR><TD SCOPE="ROW"><P CLASS="TableTextCode"><A NAME="pgfId-1003313"></A>method_info {</P><P CLASS="TableTextCode"><A NAME="pgfId-1003315"></A> u1 token</P><P CLASS="TableTextCode"><A NAME="pgfId-1003317"></A> u2 access_flags</P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -