Examples of MemberValue


Examples of javassist.bytecode.annotation.MemberValue

        {
            try
            {
                CtClass ctType = toCtClass(method.getReturnType());
               
                final MemberValue memberValue = javassist.bytecode.annotation.Annotation.createMemberValue(constPool, ctType);
                final Object value = method.invoke(source);

                memberValue.accept(new AnnotationMemberValueVisitor(constPool, getSource(), value));

                copy.addMemberValue(method.getName(), memberValue);
            }
            catch (final Exception e)
            {
View Full Code Here

Examples of javassist.bytecode.annotation.MemberValue

      Set members = info.getMemberNames();
      Iterator it = members.iterator();
      while (it.hasNext())
      {
         String name = (String) it.next();
         MemberValue mv = info.getMemberValue(name);
         ProxyMapCreator creator = new ProxyMapCreator(getMemberType(annotation, name));
         mv.accept(creator);
         map.put(name, creator.value);
      }
      return map;
   }
View Full Code Here

Examples of javassist.bytecode.annotation.MemberValue

            MethodInfo minfo = method.getMethodInfo2();
            AnnotationDefaultAttribute defAttr = (AnnotationDefaultAttribute)minfo.getAttribute(AnnotationDefaultAttribute.tag);
           
            if (defAttr != null)
            {
               MemberValue value = defAttr.getDefaultValue();    // default value of age
               MemberValueGetter getter = new MemberValueGetter(methods[i]);
               value.accept(getter);
               defaultValue = getter.getValue();
            }
           
            if (defaultValue != null)
            {
View Full Code Here

Examples of javassist.bytecode.annotation.MemberValue

         {
            return null;
         }
         else
         {
            MemberValue memberValue = annotation.getMemberValue(memberName);
            return memberValue==null ? null : memberValue.toString(); //TODO: toString() here is probably Bad ;-)
         }
      }
      else
      {
         return null;
View Full Code Here

Examples of javassist.bytecode.annotation.MemberValue

    }

    private static MemberValue toMemberValue(Object value, Class<?> componentType, ConstPool constpool, ClassPool classPool) throws NotFoundException
    {
        final CtClass type = getType(value, componentType, classPool);
        final MemberValue memberValue = javassist.bytecode.annotation.Annotation.createMemberValue(constpool, type);
        if (memberValue instanceof BooleanMemberValue) {
            ((BooleanMemberValue) memberValue).setValue((Boolean) value);
        } else if (memberValue instanceof ByteMemberValue) {
            ((ByteMemberValue) memberValue).setValue((Byte) value);
        } else if (memberValue instanceof CharMemberValue) {
View Full Code Here

Examples of javassist.bytecode.annotation.MemberValue

        if (annotation.getMemberNames() != null) {
            for (Object m : annotation.getMemberNames()) {
                final String memberName = (String) m;

                MemberValue origValue = annotation.getMemberValue(memberName);
                final MemberValue[] newValue = new MemberValue[1];

                origValue.accept(new ArrayIndexAssigningVisitor(newValue, 0, constPool));

                ret.addMemberValue(memberName, newValue[0]);
            }
        }
View Full Code Here

Examples of javassist.bytecode.annotation.MemberValue

      getLog().info("Not overwriting component meta data [" + aName + "]");
    }
  }

  private String getStringMemberValue(Annotation aAnnotation, String aValue) {
    MemberValue v = aAnnotation.getMemberValue(aValue);
    if (v == null) {
      return "";
    } else {
      return ((StringMemberValue) v).getValue();
    }
View Full Code Here

Examples of javassist.bytecode.annotation.MemberValue

        {
            try
            {
                final Object result = method.invoke(value);

                final MemberValue memberValue = Annotation.createMemberValue(
                        this.constPool,
                        this.classSource.toCtClass(result.getClass()));

                memberValue.accept(new AnnotationMemberValueVisitor(this.constPool, this.classSource, result));
               
                mb.getValue().addMemberValue(method.getName(), memberValue);
            }
            catch (Exception e)
            {
View Full Code Here

Examples of javassist.bytecode.annotation.MemberValue

       
        for (final Object object : array)
        {
            try
            {
                final MemberValue memberValue = Annotation.createMemberValue(
                        this.constPool,
                        this.classSource.toCtClass(getClass(object)));

                memberValue.accept(new AnnotationMemberValueVisitor(this.constPool, this.classSource, object));

                members.add(memberValue);
            }
            catch (final Exception e)
            {
View Full Code Here

Examples of javassist.bytecode.annotation.MemberValue

        {
            try
            {
                CtClass ctType = toCtClass(method.getReturnType());
               
                final MemberValue memberValue = javassist.bytecode.annotation.Annotation.createMemberValue(constPool, ctType);
                final Object value = method.invoke(source);

                memberValue.accept(new AnnotationMemberValueVisitor(constPool, getSource(), value));

                copy.addMemberValue(method.getName(), memberValue);
            }
            catch (final Exception e)
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.