Package javassist.bytecode

Examples of javassist.bytecode.SignatureAttribute$ArrayType


        return fieldNo;
    }

    public static void copyFieldAttributes(FieldInfo oldField, FieldInfo newField) {
        AnnotationsAttribute annotations = (AnnotationsAttribute) oldField.getAttribute(AnnotationsAttribute.visibleTag);
        SignatureAttribute sigAt = (SignatureAttribute) oldField.getAttribute(SignatureAttribute.tag);

        if (annotations != null) {
            AttributeInfo newAnnotations = annotations.copy(newField.getConstPool(), Collections.EMPTY_MAP);
            newField.addAttribute(newAnnotations);
        }
        if (sigAt != null) {
            AttributeInfo newAnnotations = sigAt.copy(newField.getConstPool(), Collections.EMPTY_MAP);
            newField.addAttribute(newAnnotations);
        }

    }
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

                            EnhancerConstants.TRACKER_FIELD_NAME+");"+
                            "return "+EnhancerConstants.TRACKER_FIELD_NAME+"; }";
            CtMethod getMethod =  CtNewMethod.make(trackerGetMethod, managedCtClass);

            MethodInfo methodInfo = getMethod.getMethodInfo();
            SignatureAttribute signatureAttribute =
                    new SignatureAttribute(methodInfo.getConstPool(), "()Ljava/util/Set<Ljava/lang/String;>;");
            methodInfo.addAttribute(signatureAttribute);
            managedCtClass.addMethod(getMethod);

        }
        catch (CannotCompileException e) {
View Full Code Here

      setTemporaryWrapperCode(type, wmethod);
      clazz.addMethod(wmethod);
     
      // copy attribute signature
      MethodInfo constructorInfo = constructor.getMethodInfo2();
      SignatureAttribute attribute = (SignatureAttribute) constructorInfo.getAttribute(SignatureAttribute.tag);
      if (attribute != null)
      {
         MethodInfo wrapperInfo = wmethod.getMethodInfo2();
         @SuppressWarnings("unchecked")
         HashMap map = new HashMap();
         wrapperInfo.addAttribute(attribute.copy(wrapperInfo.getConstPool(), map));
      }
     
      // prepare ForWrapping
      getWrapper().prepareForWrapping(constructor, CONSTRUCTOR_STATUS);
   }
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);
      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

      Instrumentor.addSyntheticAttribute(wmethod);
      clazz.addMethod(wmethod);
     
      // copy attribute signature
      MethodInfo constructorInfo = constructor.getMethodInfo2();
      SignatureAttribute attribute = (SignatureAttribute) constructorInfo.getAttribute(SignatureAttribute.tag);
      if (attribute != null)
      {
         MethodInfo wrapperInfo = wmethod.getMethodInfo2();
         @SuppressWarnings("unchecked")
         HashMap map = new HashMap();
         wrapperInfo.addAttribute(attribute.copy(wrapperInfo.getConstPool(), map));
      }
     
      // prepare ForWrapping
      getWrapper().prepareForWrapping(constructor, CONSTRUCTOR_STATUS);
   }
View Full Code Here

                            EnhancerConstants.TRACKER_FIELD_NAME+");"+
                            "return "+EnhancerConstants.TRACKER_FIELD_NAME+"; }";
            CtMethod getMethod =  CtNewMethod.make(trackerGetMethod, managedCtClass);

            MethodInfo methodInfo = getMethod.getMethodInfo();
            SignatureAttribute signatureAttribute =
                    new SignatureAttribute(methodInfo.getConstPool(), "()Ljava/util/Set<Ljava/lang/String;>;");
            methodInfo.addAttribute(signatureAttribute);
            managedCtClass.addMethod(getMethod);

        }
        catch (CannotCompileException e) {
View Full Code Here

TOP

Related Classes of javassist.bytecode.SignatureAttribute$ArrayType

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.