Package javassist.bytecode

Examples of javassist.bytecode.SignatureAttribute$Cursor


          aMethod = CtNewMethod.getter(booleanGetterName(aProp), aNewField);
        }

        inheritAnnotations(theClass, aMethod);

        SignatureAttribute attr = (SignatureAttribute) aNewField.getFieldInfo().getAttribute(SignatureAttribute.tag);
        if (attr != null) {
          aMethod.getMethodInfo().addAttribute(new SignatureAttribute(aMethod.getMethodInfo().getConstPool(), "()"+attr.getSignature()));
        }

        theClass.addMethod(aMethod);
      }

      if (!hasMethod(theClass, setterName(aProp))) {
        CtMethod aMethod = CtNewMethod.setter(setterName(aProp), aNewField);

        inheritAnnotations(theClass, aMethod);

        SignatureAttribute attr = (SignatureAttribute) aNewField.getFieldInfo().getAttribute(SignatureAttribute.tag);
        if (attr != null) {
          aMethod.getMethodInfo().addAttribute(new SignatureAttribute(aMethod.getMethodInfo().getConstPool(), "("+attr.getSignature()+")V"));
        }

        theClass.addMethod(aMethod);
      }
    }
View Full Code Here


            else {
              aName = ((Class)t).getName();
            }


            aNewField.getFieldInfo().addAttribute(new SignatureAttribute(aNewField.getFieldInfo().getConstPool(), "L"+aType.getName().replace('.','/')+ "<"+aFlag+"L" + aName.replace('.','/') + ";>;")) ;
          }
        }

        aMap.put(aProp, aNewField);
      }
View Full Code Here

   private void copySignature(CtMethod src, CtMethod dest)
   {
      javassist.bytecode.MethodInfo srcInfo = src.getMethodInfo2();
      javassist.bytecode.MethodInfo destInfo = dest.getMethodInfo2();
     
      SignatureAttribute sig = (SignatureAttribute)srcInfo.getAttribute(SignatureAttribute.tag);
      if (sig != null)
      {
         destInfo.addAttribute(sig.copy(destInfo.getConstPool(), new HashMap()));
      }
   }
View Full Code Here

   private void copySignature(CtClass src, CtClass dest)
   {
      ClassFile srcFile = src.getClassFile2();
      ClassFile destFile = dest.getClassFile2();
     
      SignatureAttribute sig = (SignatureAttribute)srcFile.getAttribute(SignatureAttribute.tag);
      if (sig != null)
      {
         destFile.addAttribute(sig.copy(destFile.getConstPool(), new HashMap()));
      }
   }
View Full Code Here

   public static void addSignature(CtField field, String signature)
   {
      FieldInfo fieldInfo = field.getFieldInfo();
      ConstPool constPool = fieldInfo.getConstPool();
      SignatureAttribute signatureAttribute = new SignatureAttribute(constPool, signature);
      fieldInfo.addAttribute(signatureAttribute);
   }
View Full Code Here

   public static void addSignature(CtMethod method, String signature)
   {
      MethodInfo methodInfo = method.getMethodInfo();
      ConstPool constPool = methodInfo.getConstPool();
      SignatureAttribute signatureAttribute = new SignatureAttribute(constPool, signature);
      methodInfo.addAttribute(signatureAttribute);
   }
View Full Code Here

      }
   }

   private void copySignature(MethodInfo src, MethodInfo dest)
   {
      SignatureAttribute attribute = (SignatureAttribute) src.getAttribute(SignatureAttribute.tag);
      if (attribute != null)
      {
         @SuppressWarnings("unchecked")
         HashMap map = new HashMap();
         dest.addAttribute(attribute.copy(dest.getConstPool(), map));
      }
   }
View Full Code Here

      CtMethod wmethod = CtNewMethod.make(CtClass.voidType, wrapperName, writeParam, null, "{}", clazz);
      wmethod.setModifiers(mod);
      Instrumentor.addSyntheticAttribute(wmethod);
      clazz.addMethod(wmethod);
     
      SignatureAttribute ai = (SignatureAttribute) field.getFieldInfo2().getAttribute(SignatureAttribute.tag);
      if (ai != null)
      {
         MethodInfo wrapperInfo = wmethod.getMethodInfo2();
         SignatureAttribute methodAtt = new SignatureAttribute(wrapperInfo.getConstPool(), "(" + ai.getSignature() + ")V");
         wrapperInfo.addAttribute(methodAtt);
      }
     
      return wmethod;
   }
View Full Code Here

   private void copySignature(CtMethod src, CtMethod dest)
   {
      javassist.bytecode.MethodInfo srcInfo = src.getMethodInfo2();
      javassist.bytecode.MethodInfo destInfo = dest.getMethodInfo2();
     
      SignatureAttribute sig = (SignatureAttribute)srcInfo.getAttribute(SignatureAttribute.tag);
      if (sig != null)
      {
         destInfo.addAttribute(sig.copy(destInfo.getConstPool(), EMPTY_HASHMAP));
      }
   }
View Full Code Here

   private void copySignature(CtClass src, CtClass dest)
   {
      ClassFile srcFile = src.getClassFile2();
      ClassFile destFile = dest.getClassFile2();
     
      SignatureAttribute sig = (SignatureAttribute)srcFile.getAttribute(SignatureAttribute.tag);
      if (sig != null)
      {
         destFile.addAttribute(sig.copy(destFile.getConstPool(), EMPTY_HASHMAP));
      }
   }
View Full Code Here

TOP

Related Classes of javassist.bytecode.SignatureAttribute$Cursor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.