org.objectweb.asm.ClassWriter#newConst ( )源码实例Demo

下面列出了org.objectweb.asm.ClassWriter#newConst ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: CodenameOne   文件: Constant.java
public
void write(final ClassWriter cw) {
    switch (type) {
        case 'I':
            cw.newConst(new Integer(intVal)); // NOPMD by xlv
            break;
        case 'J':
            cw.newConst(new Long(longVal));
            break;
        case 'F':
            cw.newConst(new Float(floatVal));
            break;
        case 'D':
            cw.newConst(new Double(doubleVal));
            break;
        case 'S':
            cw.newConst(strVal1);
            break;
        case 's':
            cw.newUTF8(strVal1);
            break;
        case 'C':
            cw.newClass(strVal1);
            break;
        case 'T':
            cw.newNameType(strVal1, strVal2);
            break;
        case 'G':
            cw.newField(strVal1, strVal2, strVal3);
            break;
        case 'M':
            cw.newMethod(strVal1, strVal2, strVal3, false);
            break;
        case 'N':
            cw.newMethod(strVal1, strVal2, strVal3, true);
            break;
    }
}
 
源代码2 项目: JByteMod-Beta   文件: Constant.java
void write(final ClassWriter cw) {
  switch (type) {
  case 'I':
    cw.newConst(intVal);
    break;
  case 'J':
    cw.newConst(longVal);
    break;
  case 'F':
    cw.newConst(floatVal);
    break;
  case 'D':
    cw.newConst(doubleVal);
    break;
  case 'S':
    cw.newConst(strVal1);
    break;
  case 's':
    cw.newUTF8(strVal1);
    break;
  case 'C':
    cw.newClass(strVal1);
    break;
  case 'T':
    cw.newNameType(strVal1, strVal2);
    break;
  case 'G':
    cw.newField(strVal1, strVal2, (String) objVal3);
    break;
  case 'M':
    cw.newMethod(strVal1, strVal2, (String) objVal3, false);
    break;
  case 'N':
    cw.newMethod(strVal1, strVal2, (String) objVal3, true);
    break;
  case 'y':
    cw.newInvokeDynamic(strVal1, strVal2, (Handle) objVal3, objVals);
    break;
  case 't':
    cw.newMethodType(strVal1);
    break;
  default: // 'h' ... 'r' : handle
    cw.newHandle(type - 'h' + 1 - ((type >= 'q') ? 4 : 0), strVal1, strVal2, (String) objVal3, type >= 'p');
  }
}