本文整理汇总了Java中com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType类的典型用法代码示例。如果您正苦于以下问题:Java ConstantNameAndType类的具体用法?Java ConstantNameAndType怎么用?Java ConstantNameAndType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConstantNameAndType类属于com.sun.org.apache.bcel.internal.classfile包,在下文中一共展示了ConstantNameAndType类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addNameAndType
import com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType; //导入依赖的package包/类
/**
* Add a new NameAndType constant to the ConstantPool if it is not already
* in there.
*
* @param name Name string to add
* @param signature signature string to add
* @return index of entry
*/
public int addNameAndType(final String name, final String signature) {
int ret;
int name_index;
int signature_index;
if ((ret = lookupNameAndType(name, signature)) != -1) {
return ret; // Already in CP
}
adjustSize();
name_index = addUtf8(name);
signature_index = addUtf8(signature);
ret = index;
constants[index++] = new ConstantNameAndType(name_index, signature_index);
final String key = name + NAT_DELIM + signature;
if (!n_a_t_table.containsKey(key)) {
n_a_t_table.put(key, new Index(ret));
}
return ret;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:ConstantPoolGen.java
示例2: getSignature
import com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType; //导入依赖的package包/类
/** @return signature of referenced method/field.
*/
public String getSignature( final ConstantPoolGen cpg ) {
final ConstantPool cp = cpg.getConstantPool();
final ConstantCP cmr = (ConstantCP) cp.getConstant(super.getIndex());
final ConstantNameAndType cnat = (ConstantNameAndType) cp.getConstant(cmr.getNameAndTypeIndex());
return ((ConstantUtf8) cp.getConstant(cnat.getSignatureIndex())).getBytes();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:FieldOrMethod.java
示例3: getName
import com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType; //导入依赖的package包/类
/** @return name of referenced method/field.
*/
public String getName( final ConstantPoolGen cpg ) {
final ConstantPool cp = cpg.getConstantPool();
final ConstantCP cmr = (ConstantCP) cp.getConstant(super.getIndex());
final ConstantNameAndType cnat = (ConstantNameAndType) cp.getConstant(cmr.getNameAndTypeIndex());
return ((ConstantUtf8) cp.getConstant(cnat.getNameIndex())).getBytes();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:FieldOrMethod.java
示例4: getClassName
import com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType; //导入依赖的package包/类
/**
* Override the parent method because our classname is held elsewhere.
*/
@Override
public String getClassName( final ConstantPoolGen cpg ) {
final ConstantPool cp = cpg.getConstantPool();
final ConstantInvokeDynamic cid = (ConstantInvokeDynamic) cp.getConstant(super.getIndex(), Const.CONSTANT_InvokeDynamic);
return ((ConstantNameAndType) cp.getConstant(cid.getNameAndTypeIndex())).getName(cp);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:INVOKEDYNAMIC.java
示例5: getNameAndType
import com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType; //导入依赖的package包/类
public ConstantNameAndType getNameAndType(final ConstantPoolGen cpg) {
final ConstantPool cp = cpg.getConstantPool();
final ConstantCP cmr = (ConstantCP) cp.getConstant(super.getIndex());
return (ConstantNameAndType) cp.getConstant(cmr.getNameAndTypeIndex());
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:NameSignatureInstruction.java
示例6: getSignature
import com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType; //导入依赖的package包/类
/** @return signature of referenced method/field.
*/
public String getSignature(final ConstantPoolGen cpg) {
final ConstantPool cp = cpg.getConstantPool();
final ConstantNameAndType cnat = getNameAndType(cpg);
return ((ConstantUtf8) cp.getConstant(cnat.getSignatureIndex())).getBytes();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:NameSignatureInstruction.java
示例7: getName
import com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType; //导入依赖的package包/类
/** @return name of referenced method/field.
*/
public String getName(final ConstantPoolGen cpg) {
final ConstantPool cp = cpg.getConstantPool();
final ConstantNameAndType cnat = getNameAndType(cpg);
return ((ConstantUtf8) cp.getConstant(cnat.getNameIndex())).getBytes();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:NameSignatureInstruction.java
注:本文中的com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论