Search in sources :

Example 61 with Element

use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.

the class AnnotationsElementVisitor method visitRuntimeVisibleParameterAnnotations.

@Override
public Element visitRuntimeVisibleParameterAnnotations(RuntimeVisibleParameterAnnotations_attribute rvpa, Element p) {
    Element e = new Element(x.getCpString(rvpa.attribute_name_index));
    for (Annotation[] pa : rvpa.parameter_annotations) {
        parseAnnotations(pa, e);
    }
    p.add(e);
    return null;
}
Also used : Element(xmlkit.XMLKit.Element) TypeAnnotation(com.sun.tools.classfile.TypeAnnotation) Annotation(com.sun.tools.classfile.Annotation)

Example 62 with Element

use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.

the class AnnotationsElementVisitor method attachTo.

private void attachTo(Element x, Object aval0) {
    if (aval0 == null) {
        return;
    }
    if (!(aval0 instanceof Element)) {
        x.add(aval0);
        return;
    }
    Element aval = (Element) aval0;
    if (!aval.isAnonymous()) {
        x.add(aval);
        return;
    }
    for (int imax = aval.attrSize(), i = 0; i < imax; i++) {
        //%%
        attachAttrTo(x, aval.getAttrName(i), aval.getAttr(i));
    }
    x.addAll(aval);
}
Also used : Element(xmlkit.XMLKit.Element)

Example 63 with Element

use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.

the class AnnotationsElementVisitor method visitRuntimeInvisibleTypeAnnotations.

@Override
public Element visitRuntimeInvisibleTypeAnnotations(RuntimeInvisibleTypeAnnotations_attribute rita, Element p) {
    Element e = new Element(x.getCpString(rita.attribute_name_index));
    for (TypeAnnotation pa : rita.annotations) {
        parseTypeAnnotations(pa, e);
    }
    e.sort();
    p.add(e);
    return null;
}
Also used : TypeAnnotation(com.sun.tools.classfile.TypeAnnotation) Element(xmlkit.XMLKit.Element)

Example 64 with Element

use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.

the class AnnotationsElementVisitor method visitPrimitive.

@Override
public Element visitPrimitive(Primitive_element_value e, Element p) {
    Element el = new Element("String");
    el.setAttr("val", x.getCpString(e.const_value_index));
    el.trimToSize();
    return el;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 65 with Element

use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.

the class AnnotationsElementVisitor method visitDefault.

@Override
public Element visitDefault(DefaultAttribute da, Element p) {
    Element e = new Element(x.getCpString(da.attribute_name_index));
    StringBuilder sb = new StringBuilder();
    for (byte x : da.info) {
        sb.append("0x").append(Integer.toHexString(x)).append(" ");
    }
    e.setAttr("bytes", sb.toString().trim());
    e.trimToSize();
    p.add(e);
    return null;
}
Also used : Element(xmlkit.XMLKit.Element)

Aggregations

Element (xmlkit.XMLKit.Element)77 ConstantPoolException (com.sun.tools.classfile.ConstantPoolException)8 TypeAnnotation (com.sun.tools.classfile.TypeAnnotation)7 Annotation (com.sun.tools.classfile.Annotation)5 StackMapTable_attribute (com.sun.tools.classfile.StackMapTable_attribute)2 AccessFlags (com.sun.tools.classfile.AccessFlags)1 Attribute (com.sun.tools.classfile.Attribute)1 BootstrapMethods_attribute (com.sun.tools.classfile.BootstrapMethods_attribute)1 CharacterRangeTable_attribute (com.sun.tools.classfile.CharacterRangeTable_attribute)1 ClassFile (com.sun.tools.classfile.ClassFile)1 Code_attribute (com.sun.tools.classfile.Code_attribute)1 DefaultAttribute (com.sun.tools.classfile.DefaultAttribute)1 Field (com.sun.tools.classfile.Field)1 Info (com.sun.tools.classfile.InnerClasses_attribute.Info)1 Instruction (com.sun.tools.classfile.Instruction)1 LineNumberTable_attribute (com.sun.tools.classfile.LineNumberTable_attribute)1 LocalVariableTable_attribute (com.sun.tools.classfile.LocalVariableTable_attribute)1 LocalVariableTypeTable_attribute (com.sun.tools.classfile.LocalVariableTypeTable_attribute)1 Method (com.sun.tools.classfile.Method)1 MethodParameters_attribute (com.sun.tools.classfile.MethodParameters_attribute)1