@Override
 public String print(int length) throws Exception {
   String space = TransformUtil.spaces(length);
   String space1 = TransformUtil.spaces(length + 4);
   String space2 = TransformUtil.spaces(length + 8);
   String result = "";
   try {
     result += space + "RuntimeVisibleParameterAnnotations : \n";
     result +=
         space1
             + "num_parameters : "
             + TransformUtil.bytesToInt(new byte[] {getNum_parameters()})
             + "\n";
     List<Parameter> parameters = getParameters();
     for (Parameter parameter : parameters) {
       result += space1 + "parameter: \n";
       result +=
           space2
               + "num_annotations: "
               + TransformUtil.bytesToInt(parameter.getNum_annotations())
               + "\n";
       List<Annotation> annotations = parameter.getAnnotations();
       for (Annotation annotation : annotations) {
         result += annotation.print(length + 8);
       }
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
   return result;
 }
示例#2
0
 @Override
 public String print(int length) {
   String space = TransformUtil.spaces(length);
   String result = "";
   String type = "";
   try {
     if (tag == CONSTANT_FIELDREF) {
       type = "field";
     } else if (tag == CONSTANT_METHODREF) {
       type = "method";
     } else if (tag == CONSTANT_INTERFACEMETHODREF) {
       type = "interfacemethod";
     }
     result =
         space
             + "const #"
             + getIndex()
             + " ="
             + type
             + space
             + "#"
             + TransformUtil.bytesToInt(class_index)
             + ".#"
             + TransformUtil.bytesToInt(name_and_type_index);
   } catch (Exception e) {
     e.printStackTrace();
   }
   return result;
 }
 @Override
 public String print(int length) throws Exception {
   String space = TransformUtil.spaces(length);
   String result = "";
   result =
       space
           + "const #"
           + getIndex()
           + " =class"
           + space
           + " #"
           + TransformUtil.bytesToInt(name_index);
   return result;
 }