Package javassist.bytecode.annotation

Examples of javassist.bytecode.annotation.EnumMemberValue


      annotation.addMemberValue(name, new StringMemberValue(value, constPool));
    }

    public void addParameter(String name, Enum value)
    {
      EnumMemberValue enumValue = new EnumMemberValue(constPool);
      enumValue.setType(value.getClass().getName());
      enumValue.setValue(value.name());
      annotation.addMemberValue(name, enumValue);
    }
View Full Code Here


      attribute.addAnnotation(annotation);

      Annotation annotation2 = new Annotation("javax.xml.ws.ServiceMode",
          constantPool);
      EnumMemberValue enumValue = new EnumMemberValue(constantPool);
      enumValue.setType("javax.xml.ws.Service$Mode");
      enumValue.setValue("MESSAGE");
      annotation2.addMemberValue("value", enumValue);
      attribute.addAnnotation(annotation2);

      if (epInfo.isAddressing() && JBossDeployerUtil.getWSImpl().equals(JBossDeployerUtil.WSIMPL_CXF))
      {
View Full Code Here

            array[index] = new FloatMemberValue(node.getValue(), constPool);
        }

        @Override
        public void visitEnumMemberValue(EnumMemberValue node) {
            EnumMemberValue val = new EnumMemberValue(constPool);
            val.setType(node.getType());
            val.setValue(node.getValue());
            array[index] = val;
        }
View Full Code Here

    javassist.bytecode.annotation.Annotation lazyAnnotation = new javassist.bytecode.annotation.Annotation(
        "org.springframework.context.annotation.Lazy", cp);
    lazyAnnotation.addMemberValue("value", new BooleanMemberValue(true, cp));
    javassist.bytecode.annotation.Annotation scopeAnnotation = new javassist.bytecode.annotation.Annotation(
        "org.springframework.context.annotation.Scope", cp);
    EnumMemberValue enumValue = new EnumMemberValue(cp);
    enumValue.setType("org.springframework.context.annotation.ScopedProxyMode");
    enumValue.setValue("TARGET_CLASS");
    scopeAnnotation.addMemberValue("proxyMode", enumValue);
    scopeAnnotation.addMemberValue("value", new StringMemberValue("idspace", cp));
    attr1.addAnnotation(beanAnnotation);
    attr1.addAnnotation(lazyAnnotation);
    attr1.addAnnotation(scopeAnnotation);
View Full Code Here

         annotation.addMemberValue(name, new StringMemberValue(value, constPool));
      }

      public void addParameter(String name, Enum value)
      {
         EnumMemberValue enumValue = new EnumMemberValue(constPool);
         enumValue.setType(value.getClass().getName());
         enumValue.setValue(value.name());
         annotation.addMemberValue(name, enumValue);
      }
View Full Code Here

         annotation.addMemberValue(name, new StringMemberValue(value, constPool));
      }

      public void addParameter(String name, Enum value)
      {
         EnumMemberValue enumValue = new EnumMemberValue(constPool);
         enumValue.setType(value.getClass().getName());
         enumValue.setValue(value.name());
         annotation.addMemberValue(name, enumValue);
      }
View Full Code Here

                }
                Annotation inheritance = new Annotation(Inheritance.class.getName(), constantPool);
                ClassPool pool = ClassPool.getDefault();
                pool.importPackage("javax.persistence");
                pool.importPackage("java.lang");
                EnumMemberValue strategy = (EnumMemberValue) Annotation.createMemberValue(constantPool, pool.makeClass("InheritanceType"));
                strategy.setType(InheritanceType.class.getName());
                strategy.setValue(InheritanceType.SINGLE_TABLE.name());
                inheritance.addMemberValue("strategy", strategy);
                annotationsAttribute.addAnnotation(inheritance);
                if (myInfo.getDiscriminatorName() != null) {
                    Annotation discriminator = new Annotation(DiscriminatorColumn.class.getName(), constantPool);
                    StringMemberValue name = new StringMemberValue(constantPool);
                    name.setValue(myInfo.getDiscriminatorName());
                    discriminator.addMemberValue("name", name);
                    EnumMemberValue discriminatorType = (EnumMemberValue) Annotation.createMemberValue(constantPool, pool.makeClass("DiscriminatorType"));
                    discriminatorType.setType(DiscriminatorType.class.getName());
                    discriminatorType.setValue(myInfo.getDiscriminatorType().name());
                    discriminator.addMemberValue("discriminatorType", discriminatorType);
                    IntegerMemberValue length = new IntegerMemberValue(constantPool);
                    length.setValue(myInfo.getDiscriminatorLength());
                    discriminator.addMemberValue("length", length);
                   
View Full Code Here

        } else if (type == String.class) {
            return new StringMemberValue((String) val, cp);
        } else if (type == Class.class) {
            return new ClassMemberValue(((Class<?>) val).getName(), cp);
        } else if (type.isEnum()) {
            EnumMemberValue e = new EnumMemberValue(cp);
            e.setType(type.getName());
            e.setValue(((Enum<?>) val).name());
            return e;
        } else if (type.isAnnotation()) {
            return new AnnotationMemberValue(createJavassistAnnotation((java.lang.annotation.Annotation) val, cp), cp);
        } else if (type.isArray()) {
            Class<?> arrayType = type.getComponentType();
View Full Code Here

        } else if (type == String.class) {
            return new StringMemberValue(cp);
        } else if (type == Class.class) {
            return new ClassMemberValue(cp);
        } else if (type.isEnum()) {
            EnumMemberValue e = new EnumMemberValue(cp);
            e.setType(type.getName());
            return e;
        } else if (type.isAnnotation()) {
            AnnotationMemberValue a = new AnnotationMemberValue(cp);
            return a;
        } else if (type.isArray()) {
View Full Code Here

                    // Workaround for https://hibernate.onjira.com/browse/EJB-346
                    if (field.isAnnotationPresent(OneToMany.class) && field.getType().isAssignableFrom(List.class)
                            && FetchType.EAGER == field.getAnnotation(OneToMany.class).fetch()) {

                        Annotation fetchAnnot = new Annotation("org.hibernate.annotations.Fetch", constPool);
                        EnumMemberValue emb = new EnumMemberValue(constPool);
                        emb.setType("org.hibernate.annotations.FetchMode");
                        emb.setValue("SUBSELECT");
                        fetchAnnot.addMemberValue("value", emb);

                        annotAttr = new AnnotationsAttribute(constPool, AnnotationsAttribute.visibleTag);
                        annotAttr.addAnnotation(fetchAnnot);
                    }
View Full Code Here

TOP

Related Classes of javassist.bytecode.annotation.EnumMemberValue

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.