Java Code Examples for org.objectweb.asm.TypePath#fromString()

The following examples show how to use org.objectweb.asm.TypePath#fromString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ASMContentHandler.java    From JByteMod-Beta with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void begin(final String name, final Attributes attrs) {
  String desc = attrs.getValue("desc");
  boolean visible = Boolean.valueOf(attrs.getValue("visible")).booleanValue();
  int typeRef = Integer.parseInt(attrs.getValue("typeRef"));
  TypePath typePath = TypePath.fromString(attrs.getValue("typePath"));

  Object v = peek();
  if (v instanceof ClassVisitor) {
    push(((ClassVisitor) v).visitTypeAnnotation(typeRef, typePath, desc, visible));
  } else if (v instanceof FieldVisitor) {
    push(((FieldVisitor) v).visitTypeAnnotation(typeRef, typePath, desc, visible));
  } else if (v instanceof MethodVisitor) {
    push(((MethodVisitor) v).visitTypeAnnotation(typeRef, typePath, desc, visible));
  }
}
 
Example 2
Source File: ASMContentHandler.java    From JByteMod-Beta with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void begin(final String name, final Attributes attrs) {
  String desc = attrs.getValue("desc");
  boolean visible = Boolean.valueOf(attrs.getValue("visible")).booleanValue();
  int typeRef = Integer.parseInt(attrs.getValue("typeRef"));
  TypePath typePath = TypePath.fromString(attrs.getValue("typePath"));
  String[] s = attrs.getValue("start").split(" ");
  Label[] start = new Label[s.length];
  for (int i = 0; i < start.length; ++i) {
    start[i] = getLabel(s[i]);
  }
  String[] e = attrs.getValue("end").split(" ");
  Label[] end = new Label[e.length];
  for (int i = 0; i < end.length; ++i) {
    end[i] = getLabel(e[i]);
  }
  String[] v = attrs.getValue("index").split(" ");
  int[] index = new int[v.length];
  for (int i = 0; i < index.length; ++i) {
    index[i] = Integer.parseInt(v[i]);
  }
  push(((MethodVisitor) peek()).visitLocalVariableAnnotation(typeRef, typePath, start, end, index, desc, visible));
}
 
Example 3
Source File: ASMContentHandler.java    From JByteMod-Beta with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void begin(final String name, final Attributes attrs) {
  String desc = attrs.getValue("desc");
  boolean visible = Boolean.valueOf(attrs.getValue("visible")).booleanValue();
  int typeRef = Integer.parseInt(attrs.getValue("typeRef"));
  TypePath typePath = TypePath.fromString(attrs.getValue("typePath"));
  push(((MethodVisitor) peek()).visitInsnAnnotation(typeRef, typePath, desc, visible));
}
 
Example 4
Source File: ASMContentHandler.java    From JByteMod-Beta with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void begin(final String name, final Attributes attrs) {
  String desc = attrs.getValue("desc");
  boolean visible = Boolean.valueOf(attrs.getValue("visible")).booleanValue();
  int typeRef = Integer.parseInt(attrs.getValue("typeRef"));
  TypePath typePath = TypePath.fromString(attrs.getValue("typePath"));
  push(((MethodVisitor) peek()).visitTryCatchAnnotation(typeRef, typePath, desc, visible));
}