Search in sources :

Example 46 with Constant

use of com.taobao.android.dx.rop.cst.Constant in project atlas by alibaba.

the class AnnotationParser method parseConstant.

/**
 * Helper for {@link #parseValue}, which parses a constant reference
 * and returns the referred-to constant value.
 *
 * @return {@code non-null;} the parsed value
 */
private Constant parseConstant() throws IOException {
    int constValueIndex = input.readUnsignedShort();
    Constant value = (Constant) pool.get(constValueIndex);
    if (observer != null) {
        String human = (value instanceof CstString) ? ((CstString) value).toQuoted() : value.toHuman();
        parsed(2, "constant_value: " + human);
    }
    return value;
}
Also used : Constant(com.taobao.android.dx.rop.cst.Constant) CstString(com.taobao.android.dx.rop.cst.CstString) CstString(com.taobao.android.dx.rop.cst.CstString)

Aggregations

Constant (com.taobao.android.dx.rop.cst.Constant)46 RegisterSpecList (com.taobao.android.dx.rop.code.RegisterSpecList)17 CstType (com.taobao.android.dx.rop.cst.CstType)16 CstString (com.taobao.android.dx.rop.cst.CstString)15 CstInsn (com.taobao.android.dx.dex.code.CstInsn)12 TypedConstant (com.taobao.android.dx.rop.cst.TypedConstant)11 RegisterSpec (com.taobao.android.dx.rop.code.RegisterSpec)10 CstFieldRef (com.taobao.android.dx.rop.cst.CstFieldRef)9 CstLiteralBits (com.taobao.android.dx.rop.cst.CstLiteralBits)9 CstInteger (com.taobao.android.dx.rop.cst.CstInteger)6 CstMethodRef (com.taobao.android.dx.rop.cst.CstMethodRef)6 Type (com.taobao.android.dx.rop.type.Type)5 NameValuePair (com.taobao.android.dx.rop.annotation.NameValuePair)4 Insn (com.taobao.android.dx.rop.code.Insn)4 PlainInsn (com.taobao.android.dx.rop.code.PlainInsn)4 TypeBearer (com.taobao.android.dx.rop.type.TypeBearer)4 Rop (com.taobao.android.dx.rop.code.Rop)3 ThrowingCstInsn (com.taobao.android.dx.rop.code.ThrowingCstInsn)3 CstInterfaceMethodRef (com.taobao.android.dx.rop.cst.CstInterfaceMethodRef)3 ArrayList (java.util.ArrayList)3