Search in sources :

Example 36 with CstString

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

the class ProtoIdItem method makeShortForm.

/**
 * Creates the short-form of the given prototype.
 *
 * @param prototype {@code non-null;} the prototype
 * @return {@code non-null;} the short form
 */
private static CstString makeShortForm(Prototype prototype) {
    StdTypeList parameters = prototype.getParameterTypes();
    int size = parameters.size();
    StringBuilder sb = new StringBuilder(size + 1);
    sb.append(shortFormCharFor(prototype.getReturnType()));
    for (int i = 0; i < size; i++) {
        sb.append(shortFormCharFor(parameters.getType(i)));
    }
    return new CstString(sb.toString());
}
Also used : StdTypeList(com.taobao.android.dx.rop.type.StdTypeList) CstString(com.taobao.android.dx.rop.cst.CstString)

Aggregations

CstString (com.taobao.android.dx.rop.cst.CstString)36 CstType (com.taobao.android.dx.rop.cst.CstType)16 Constant (com.taobao.android.dx.rop.cst.Constant)14 ConstantPool (com.taobao.android.dx.rop.cst.ConstantPool)7 ByteArray (com.taobao.android.dx.util.ByteArray)7 CstFieldRef (com.taobao.android.dx.rop.cst.CstFieldRef)6 ParseException (com.taobao.android.dx.cf.iface.ParseException)5 NameValuePair (com.taobao.android.dx.rop.annotation.NameValuePair)5 RegisterSpec (com.taobao.android.dx.rop.code.RegisterSpec)5 CstNat (com.taobao.android.dx.rop.cst.CstNat)5 ClassDefItem (com.taobao.android.dx.dex.file.ClassDefItem)4 Annotation (com.taobao.android.dx.rop.annotation.Annotation)4 CstMethodRef (com.taobao.android.dx.rop.cst.CstMethodRef)4 Type (com.taobao.android.dx.rop.type.Type)4 Annotations (com.taobao.android.dx.rop.annotation.Annotations)3 CstAnnotation (com.taobao.android.dx.rop.cst.CstAnnotation)3 CstEnumRef (com.taobao.android.dx.rop.cst.CstEnumRef)3 CstInterfaceMethodRef (com.taobao.android.dx.rop.cst.CstInterfaceMethodRef)3 TypedConstant (com.taobao.android.dx.rop.cst.TypedConstant)3 Attribute (com.taobao.android.dx.cf.iface.Attribute)2