Search in sources :

Example 1 with AnnotationElement

use of com.googlecode.d2j.dex.writer.ev.EncodedAnnotation.AnnotationElement in project dex2jar by pxb1988.

the class AnnotationWriter method newAnnotationElement.

AnnotationElement newAnnotationElement(String name) {
    AnnotationElement ae = new AnnotationElement();
    ae.name = cp.uniqString(name);
    elements.add(ae);
    return ae;
}
Also used : AnnotationElement(com.googlecode.d2j.dex.writer.ev.EncodedAnnotation.AnnotationElement)

Example 2 with AnnotationElement

use of com.googlecode.d2j.dex.writer.ev.EncodedAnnotation.AnnotationElement in project dex2jar by pxb1988.

the class AnnotationWriter method visitAnnotation.

@Override
public DexAnnotationVisitor visitAnnotation(String name, String desc) {
    EncodedValue encodedValue;
    EncodedAnnotation encodedAnnotation = new EncodedAnnotation();
    encodedAnnotation.type = cp.uniqType(desc);
    encodedValue = new EncodedValue(EncodedValue.VALUE_ANNOTATION, encodedAnnotation);
    AnnotationElement ae = newAnnotationElement(name);
    ae.value = encodedValue;
    return new AnnotationWriter(encodedAnnotation.elements, cp);
}
Also used : EncodedValue(com.googlecode.d2j.dex.writer.ev.EncodedValue) AnnotationElement(com.googlecode.d2j.dex.writer.ev.EncodedAnnotation.AnnotationElement) EncodedAnnotation(com.googlecode.d2j.dex.writer.ev.EncodedAnnotation)

Example 3 with AnnotationElement

use of com.googlecode.d2j.dex.writer.ev.EncodedAnnotation.AnnotationElement in project dex2jar by pxb1988.

the class AnnotationWriter method visit.

// int,int long
public void visit(String name, Object value) {
    if (value instanceof Object[]) {
        DexAnnotationVisitor s = visitArray(name);
        if (s != null) {
            for (Object v : (Object[]) value) {
                s.visit(null, v);
            }
            s.visitEnd();
        }
    } else {
        AnnotationElement ae = newAnnotationElement(name);
        ae.value = EncodedValue.wrap(cp.wrapEncodedItem(value));
    }
}
Also used : AnnotationElement(com.googlecode.d2j.dex.writer.ev.EncodedAnnotation.AnnotationElement) DexAnnotationVisitor(com.googlecode.d2j.visitors.DexAnnotationVisitor)

Example 4 with AnnotationElement

use of com.googlecode.d2j.dex.writer.ev.EncodedAnnotation.AnnotationElement in project dex2jar by pxb1988.

the class AnnotationWriter method visitEnum.

@Override
public void visitEnum(String name, String fower, String fname) {
    AnnotationElement ae = newAnnotationElement(name);
    ae.value = new EncodedValue(EncodedValue.VALUE_ENUM, cp.uniqField(fower, fname, fower));
}
Also used : EncodedValue(com.googlecode.d2j.dex.writer.ev.EncodedValue) AnnotationElement(com.googlecode.d2j.dex.writer.ev.EncodedAnnotation.AnnotationElement)

Example 5 with AnnotationElement

use of com.googlecode.d2j.dex.writer.ev.EncodedAnnotation.AnnotationElement in project dex2jar by pxb1988.

the class AnnotationWriter method visitArray.

@Override
public DexAnnotationVisitor visitArray(String name) {
    AnnotationElement ae = newAnnotationElement(name);
    final EncodedArray encodedArray = new EncodedArray();
    ae.value = new EncodedValue(EncodedValue.VALUE_ARRAY, encodedArray);
    return new EncodedArrayAnnWriter(encodedArray);
}
Also used : EncodedValue(com.googlecode.d2j.dex.writer.ev.EncodedValue) AnnotationElement(com.googlecode.d2j.dex.writer.ev.EncodedAnnotation.AnnotationElement) EncodedArray(com.googlecode.d2j.dex.writer.ev.EncodedArray)

Aggregations

AnnotationElement (com.googlecode.d2j.dex.writer.ev.EncodedAnnotation.AnnotationElement)5 EncodedValue (com.googlecode.d2j.dex.writer.ev.EncodedValue)3 EncodedAnnotation (com.googlecode.d2j.dex.writer.ev.EncodedAnnotation)1 EncodedArray (com.googlecode.d2j.dex.writer.ev.EncodedArray)1 DexAnnotationVisitor (com.googlecode.d2j.visitors.DexAnnotationVisitor)1