• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ClassEntry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.java.util.jar.pack.ConstantPool.ClassEntry的典型用法代码示例。如果您正苦于以下问题:Java ClassEntry类的具体用法?Java ClassEntry怎么用?Java ClassEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ClassEntry类属于com.sun.java.util.jar.pack.ConstantPool包,在下文中一共展示了ClassEntry类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: readMemberRefs

import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; //导入依赖的package包/类
void readMemberRefs(byte tag, Entry[] cpMap, CPRefBand cp_class, CPRefBand cp_desc) throws IOException {
    //  cp_Field:
    //        *cp_Field_class :DELTA5  (cp_Class)
    //        *cp_Field_desc :UDELTA5  (cp_Descr)
    //  cp_Method:
    //        *cp_Method_class :DELTA5  (cp_Class)
    //        *cp_Method_desc :UDELTA5  (cp_Descr)
    //  cp_Imethod:
    //        *cp_Imethod_class :DELTA5  (cp_Class)
    //        *cp_Imethod_desc :UDELTA5  (cp_Descr)
    cp_class.expectLength(cpMap.length);
    cp_class.readFrom(in);
    cp_class.setIndex(getCPIndex(CONSTANT_Class));
    cp_desc.expectLength(cpMap.length);
    cp_desc.readFrom(in);
    cp_desc.setIndex(getCPIndex(CONSTANT_NameandType));
    for (int i = 0; i < cpMap.length; i++) {
        ClassEntry      mclass = (ClassEntry     ) cp_class.getRef();
        DescriptorEntry mdescr = (DescriptorEntry) cp_desc.getRef();
        cpMap[i] = ConstantPool.getMemberEntry(tag, mclass, mdescr);
    }
    cp_class.doneDisbursing();
    cp_desc.doneDisbursing();
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:25,代码来源:PackageReader.java


示例2: readLocalInnerClasses

import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; //导入依赖的package包/类
void readLocalInnerClasses(Class cls) throws IOException {
    int nc = class_InnerClasses_N.getInt();
    List<InnerClass> localICs = new ArrayList<>(nc);
    for (int i = 0; i < nc; i++) {
        ClassEntry thisClass = (ClassEntry) class_InnerClasses_RC.getRef();
        int        flags     =              class_InnerClasses_F.getInt();
        if (flags == 0) {
            // A zero flag means copy a global IC here.
            InnerClass ic = pkg.getGlobalInnerClass(thisClass);
            assert(ic != null);  // must be a valid global IC reference
            localICs.add(ic);
        } else {
            if (flags == ACC_IC_LONG_FORM)
                flags = 0;  // clear the marker bit
            ClassEntry outer = (ClassEntry) class_InnerClasses_outer_RCN.getRef();
            Utf8Entry name   = (Utf8Entry)  class_InnerClasses_name_RUN.getRef();
            localICs.add(new InnerClass(thisClass, outer, name, flags));
        }
    }
    cls.setInnerClasses(localICs);
    // cls.expandLocalICs may add more tuples to ics also,
    // or may even delete tuples.
    // We cannot do that now, because we do not know the
    // full contents of the local constant pool yet.
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:26,代码来源:PackageReader.java


示例3: Class

import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; //导入依赖的package包/类
Class(int flags, ClassEntry thisClass, ClassEntry superClass, ClassEntry[] interfaces) {
    this.magic      = JAVA_MAGIC;
    this.version    = defaultClassVersion;
    this.flags      = flags;
    this.thisClass  = thisClass;
    this.superClass = superClass;
    this.interfaces = interfaces;

    boolean added = classes.add(this);
    assert(added);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:Package.java


示例4: InnerClass

import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; //导入依赖的package包/类
InnerClass(ClassEntry thisClass, ClassEntry outerClass,
           Utf8Entry name, int flags) {
    this.thisClass = thisClass;
    this.outerClass = outerClass;
    this.name = name;
    this.flags = flags;
    this.predictable = computePredictable();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:Package.java


示例5: readHeader

import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; //导入依赖的package包/类
void readHeader() throws IOException {
    cls.flags = readUnsignedShort();
    cls.thisClass = readClassRef();
    cls.superClass = readClassRefOrNull();
    int ni = readUnsignedShort();
    cls.interfaces = new ClassEntry[ni];
    for (int i = 0; i < ni; i++) {
        cls.interfaces[i] = readClassRef();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:ClassReader.java


示例6: Class

import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; //导入依赖的package包/类
Class(int flags, ClassEntry thisClass, ClassEntry superClass, ClassEntry[] interfaces) {
    this.magic      = JAVA_MAGIC;
    this.minver     = default_class_minver;
    this.majver     = default_class_majver;
    this.flags      = flags;
    this.thisClass  = thisClass;
    this.superClass = superClass;
    this.interfaces = interfaces;

    boolean added = classes.add(this);
    assert(added);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:13,代码来源:Package.java


示例7: writeClassesAndByteCodes

import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; //导入依赖的package包/类
void writeClassesAndByteCodes() throws IOException {
    Class[] classes = new Class[pkg.classes.size()];
    pkg.classes.toArray(classes);
    // Note:  This code respects the order in which caller put classes.
    if (verbose > 0)
        Utils.log.info("  ...scanning "+classes.length+" classes...");

    int nwritten = 0;
    for (int i = 0; i < classes.length; i++) {
        // Collect the class body, sans bytecodes.
        Class cls = classes[i];
        if (verbose > 1)
            Utils.log.fine("Scanning "+cls);

        ClassEntry   thisClass  = cls.thisClass;
        ClassEntry   superClass = cls.superClass;
        ClassEntry[] interfaces = cls.interfaces;
        // Encode rare case of null superClass as thisClass:
        assert(superClass != thisClass);  // bad class file!?
        if (superClass == null)  superClass = thisClass;
        class_this.putRef(thisClass);
        class_super.putRef(superClass);
        class_interface_count.putInt(cls.interfaces.length);
        for (int j = 0; j < interfaces.length; j++) {
            class_interface.putRef(interfaces[j]);
        }

        writeMembers(cls);
        writeAttrs(ATTR_CONTEXT_CLASS, cls, cls);

        nwritten++;
        if (verbose > 0 && (nwritten % 1000) == 0)
            Utils.log.info("Have scanned "+nwritten+" classes...");
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:36,代码来源:PackageWriter.java


示例8: initOpVariant

import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; //导入依赖的package包/类
private int initOpVariant(Instruction i, Entry newClass) {
    if (i.getBC() != _invokespecial)  return -1;
    MemberEntry ref = (MemberEntry) i.getCPRef(curCPMap);
    if ("<init>".equals(ref.descRef.nameRef.stringValue()) == false)
        return -1;
    ClassEntry refClass = ref.classRef;
    if (refClass == curClass.thisClass)
        return _invokeinit_op+_invokeinit_self_option;
    if (refClass == curClass.superClass)
        return _invokeinit_op+_invokeinit_super_option;
    if (refClass == newClass)
        return _invokeinit_op+_invokeinit_new_option;
    return -1;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:15,代码来源:PackageWriter.java


示例9: selfOpVariant

import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; //导入依赖的package包/类
private int selfOpVariant(Instruction i) {
    int bc = i.getBC();
    if (!(bc >= _first_linker_op && bc <= _last_linker_op))  return -1;
    MemberEntry ref = (MemberEntry) i.getCPRef(curCPMap);
    ClassEntry refClass = ref.classRef;
    int self_bc = _self_linker_op + (bc - _first_linker_op);
    if (refClass == curClass.thisClass)
        return self_bc;
    if (refClass == curClass.superClass)
        return self_bc + _self_linker_super_flag;
    return -1;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:13,代码来源:PackageWriter.java



注:本文中的com.sun.java.util.jar.pack.ConstantPool.ClassEntry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LanguageParserDefinitions类代码示例发布时间:2022-05-21
下一篇:
Java AbsSavedState类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap