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

Java Utf8Entry类代码示例

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

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



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

示例1: readLocalInnerClasses

import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; //导入依赖的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


示例2: transformSourceFile

import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; //导入依赖的package包/类
private void transformSourceFile(boolean minimize) {
    // Replace "obvious" SourceFile by null.
    Attribute olda = getAttribute(attrSourceFileSpecial);
    if (olda == null)
        return;  // no SourceFile attr.
    String obvious = getObviousSourceFile();
    List<Entry> ref = new ArrayList<>(1);
    olda.visitRefs(this, VRM_PACKAGE, ref);
    Utf8Entry sfName = (Utf8Entry) ref.get(0);
    Attribute a = olda;
    if (sfName == null) {
        if (minimize) {
            // A pair of zero bytes.  Cannot use predef. layout.
            a = Attribute.find(ATTR_CONTEXT_CLASS, "SourceFile", "H");
            a = a.addContent(new byte[2]);
        } else {
            // Expand null attribute to the obvious string.
            byte[] bytes = new byte[2];
            sfName = getRefString(obvious);
            Object f = null;
            f = Fixups.addRefWithBytes(f, bytes, sfName);
            a = attrSourceFileSpecial.addContent(bytes, f);
        }
    } else if (obvious.equals(sfName.stringValue())) {
        if (minimize) {
            // Replace by an all-zero attribute.
            a = attrSourceFileSpecial.addContent(new byte[2]);
        } else {
            assert(false);
        }
    }
    if (a != olda) {
        if (verbose > 2)
            Utils.log.fine("recoding obvious SourceFile="+obvious);
        List<Attribute> newAttrs = new ArrayList<>(getAttributes());
        int where = newAttrs.indexOf(olda);
        newAttrs.set(where, a);
        setAttributes(newAttrs);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:Package.java


示例3: InnerClass

import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; //导入依赖的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


示例4: readMember

import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; //导入依赖的package包/类
void readMember(boolean doMethod) throws IOException {
    int    mflags = readUnsignedShort();
    Utf8Entry       mname = readUtf8Ref();
    SignatureEntry  mtype = readSignatureRef();
    DescriptorEntry descr = ConstantPool.getDescriptorEntry(mname, mtype);
    Class.Member m;
    if (!doMethod)
        m = cls.new Field(mflags, descr);
    else
        m = cls.new Method(mflags, descr);
    readAttributes(!doMethod ? ATTR_CONTEXT_FIELD : ATTR_CONTEXT_METHOD,
                   m);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:ClassReader.java


示例5: readInnerClasses

import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; //导入依赖的package包/类
void readInnerClasses(Class cls) throws IOException {
    int nc = readUnsignedShort();
    ArrayList<InnerClass> ics = new ArrayList<>(nc);
    for (int i = 0; i < nc; i++) {
        InnerClass ic =
            new InnerClass(readClassRef(),
                           readClassRefOrNull(),
                           (Utf8Entry)readRefOrNull(CONSTANT_Utf8),
                           readUnsignedShort());
        ics.add(ic);
    }
    cls.innerClasses = ics;  // set directly; do not use setInnerClasses.
    // (Later, ics may be transferred to the pkg.)
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:ClassReader.java


示例6: transformSourceFile

import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; //导入依赖的package包/类
private void transformSourceFile(boolean minimize) {
    // Replace "obvious" SourceFile by null.
    Attribute olda = getAttribute(attrSourceFileSpecial);
    if (olda == null)
        return;  // no SourceFile attr.
    String obvious = getObviousSourceFile();
    List<Entry> ref = new ArrayList<>(1);
    olda.visitRefs(this, VRM_PACKAGE, ref);
    Utf8Entry sfName = (Utf8Entry) ref.get(0);
    Attribute a = olda;
    if (sfName == null) {
        if (minimize) {
            // A pair of zero bytes.  Cannot use predef. layout.
            a = Attribute.find(ATTR_CONTEXT_CLASS, "SourceFile", "H");
            a = a.addContent(new byte[2]);
        } else {
            // Expand null attribute to the obvious string.
            byte[] bytes = new byte[2];
            sfName = getRefString(obvious);
            Object f = null;
            f = Fixups.add(f, bytes, 0, Fixups.U2_FORMAT, sfName);
            a = attrSourceFileSpecial.addContent(bytes, f);
        }
    } else if (obvious.equals(sfName.stringValue())) {
        if (minimize) {
            // Replace by an all-zero attribute.
            a = attrSourceFileSpecial.addContent(new byte[2]);
        } else {
            assert(false);
        }
    }
    if (a != olda) {
        if (verbose > 2)
            Utils.log.fine("recoding obvious SourceFile="+obvious);
        List<Attribute> newAttrs = new ArrayList<>(getAttributes());
        int where = newAttrs.indexOf(olda);
        newAttrs.set(where, a);
        setAttributes(newAttrs);
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:41,代码来源:Package.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java KillJobRequest类代码示例发布时间:2022-05-21
下一篇:
Java TableElement类代码示例发布时间: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