本文整理汇总了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());
}
}
示例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());
}
示例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);
}
示例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;
}
示例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());
}
示例6: parseMemberValue
import scouter.javassist.bytecode.annotation.MemberValue; //导入依赖的package包/类
MemberValue parseMemberValue() throws Exception {
memberValue(0);
return currentMember;
}