当前位置: 首页>>代码示例>>Java>>正文


Java MemberValue类代码示例

本文整理汇总了Java中scouter.javassist.bytecode.annotation.MemberValue的典型用法代码示例。如果您正苦于以下问题:Java MemberValue类的具体用法?Java MemberValue怎么用?Java MemberValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getDefaultValue

import scouter.javassist.bytecode.annotation.MemberValue; //导入依赖的package包/类
/**
 * Obtains the default value represented by this attribute.
 */
public MemberValue getDefaultValue()
{
   try {
       return new AnnotationsAttribute.Parser(info, constPool)
                                      .parseMemberValue();
   }
   catch (Exception e) {
       throw new RuntimeException(e.toString());
   }
}
 
开发者ID:scouter-project,项目名称:bytescope,代码行数:14,代码来源:AnnotationDefaultAttribute.java

示例2: setDefaultValue

import scouter.javassist.bytecode.annotation.MemberValue; //导入依赖的package包/类
/**
 * Changes the default value represented by this attribute.
 *
 * @param value         the new value.
 * @see scouter.javassist.bytecode.annotation.Annotation#createMemberValue(ConstPool, CtClass)
 */
public void setDefaultValue(MemberValue value) {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    AnnotationsWriter writer = new AnnotationsWriter(output, constPool);
    try {
        value.write(writer);
        writer.close();
    }
    catch (IOException e) {
        throw new RuntimeException(e);      // should never reach here.
    }

    set(output.toByteArray());
    
}
 
开发者ID:scouter-project,项目名称:bytescope,代码行数:21,代码来源:AnnotationDefaultAttribute.java

示例3: constValueMember

import scouter.javassist.bytecode.annotation.MemberValue; //导入依赖的package包/类
void constValueMember(int tag, int index) throws Exception {
    MemberValue m;
    ConstPool cp = pool;
    switch (tag) {
    case 'B' :
        m = new ByteMemberValue(index, cp);
        break;
    case 'C' :
        m = new CharMemberValue(index, cp);
        break;
    case 'D' :
        m = new DoubleMemberValue(index, cp);
        break;
    case 'F' :
        m = new FloatMemberValue(index, cp);
        break;
    case 'I' :
        m = new IntegerMemberValue(index, cp);
        break;
    case 'J' :
        m = new LongMemberValue(index, cp);
        break;
    case 'S' :
        m = new ShortMemberValue(index, cp);
        break;
    case 'Z' :
        m = new BooleanMemberValue(index, cp);
        break;
    case 's' :
        m = new StringMemberValue(index, cp);
        break;
    default :
        throw new RuntimeException("unknown tag:" + tag);
    }

    currentMember = m;
    super.constValueMember(tag, index);
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:39,代码来源:AnnotationsAttribute.java

示例4: arrayMemberValue

import scouter.javassist.bytecode.annotation.MemberValue; //导入依赖的package包/类
int arrayMemberValue(int pos, int num) throws Exception {
    ArrayMemberValue amv = new ArrayMemberValue(pool);
    MemberValue[] elements = new MemberValue[num];
    for (int i = 0; i < num; ++i) {
        pos = memberValue(pos);
        elements[i] = currentMember;
    }

    amv.setValue(elements);
    currentMember = amv;
    return pos;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:13,代码来源:AnnotationsAttribute.java

示例5: setDefaultValue

import scouter.javassist.bytecode.annotation.MemberValue; //导入依赖的package包/类
/**
 * Changes the default value represented by this attribute.
 *
 * @param value         the new value.
 * @see Annotation#createMemberValue(ConstPool, CtClass)
 */
public void setDefaultValue(MemberValue value) {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    AnnotationsWriter writer = new AnnotationsWriter(output, constPool);
    try {
        value.write(writer);
        writer.close();
    }
    catch (IOException e) {
        throw new RuntimeException(e);      // should never reach here.
    }

    set(output.toByteArray());
    
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:21,代码来源:AnnotationDefaultAttribute.java

示例6: parseMemberValue

import scouter.javassist.bytecode.annotation.MemberValue; //导入依赖的package包/类
MemberValue parseMemberValue() throws Exception {
    memberValue(0);
    return currentMember;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:5,代码来源:AnnotationsAttribute.java


注:本文中的scouter.javassist.bytecode.annotation.MemberValue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。