Package javassist.bytecode.annotation

Examples of javassist.bytecode.annotation.StringMemberValue


      this.constPool = constPool;
    }

    public void addParameter(String name, String value)
    {
      annotation.addMemberValue(name, new StringMemberValue(value, constPool));
    }
View Full Code Here


    public void addParameter(String name, String[] values)
    {
      ArrayMemberValue member = new ArrayMemberValue(constPool);
      StringMemberValue[] members = new StringMemberValue[values.length];
      for (int i = 0; i < values.length; i++)
        members[i] = new StringMemberValue(values[i], constPool);
      member.setValue(members);
      annotation.addMemberValue(name, member);
    }
View Full Code Here

                        ctClass.addMethod(ctMethod);

                        // add GoGo descriptor for this shell command
                        AnnotationsAttribute annotationsAttribute = new AnnotationsAttribute(constPool, AnnotationsAttribute.visibleTag);
                        Annotation annotation = new Annotation(Descriptor.class.getName(), constPool);
                        annotation.addMemberValue("value", new StringMemberValue(commands.get(name), constPool));
                        annotationsAttribute.addAnnotation(annotation);
                        ctMethod.getMethodInfo().addAttribute(annotationsAttribute);
                    }
                }
            }
View Full Code Here

        "javax.enterprise.inject.Produces", cp);
    javassist.bytecode.annotation.Annotation zkScopedAnnotation = new javassist.bytecode.annotation.Annotation(
        "org.zkoss.cdi.context.IdSpaceScoped", cp);
    javassist.bytecode.annotation.Annotation zkCompAnnotation = new javassist.bytecode.annotation.Annotation(
        "org.zkoss.cdi.inject.ComponentId", cp);
    zkCompAnnotation.addMemberValue("value", new StringMemberValue(field
        .getName(), cp));
   
    attr.addAnnotation(producesAnnotation);
    attr.addAnnotation(zkScopedAnnotation);
    attr.addAnnotation(zkCompAnnotation);
View Full Code Here

      AnnotationsAttribute attribute = new AnnotationsAttribute(
          constantPool, AnnotationsAttribute.visibleTag);
      Annotation annotation = new Annotation(
          "javax.xml.ws.WebServiceProvider", constantPool);
      StringMemberValue strValue1 = new StringMemberValue(constantPool);
      strValue1.setValue(epInfo.getWSDLFileName());
      annotation.addMemberValue("wsdlLocation", strValue1);
      StringMemberValue strValue2 = new StringMemberValue(constantPool);
      strValue2.setValue(epInfo.getServiceName());
      annotation.addMemberValue("serviceName", strValue2);
      StringMemberValue strValue3 = new StringMemberValue(constantPool);
      strValue3.setValue(epInfo.getPortName());
      annotation.addMemberValue("portName", strValue3);

      StringMemberValue strValue4 = new StringMemberValue(constantPool);
      strValue4.setValue(epInfo.getNamespace());
      annotation.addMemberValue("targetNamespace", strValue4);

      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))
      {
        Annotation annotation3 = new Annotation("javax.xml.ws.soap.Addressing", constantPool);
        BooleanMemberValue boolEnabled = new BooleanMemberValue(constantPool);
        boolEnabled.setValue(true);
        BooleanMemberValue boolRequired = new BooleanMemberValue(constantPool);
        boolRequired.setValue(true);
        annotation3.addMemberValue("enabled", boolEnabled);
        annotation3.addMemberValue("required", boolEnabled);
        attribute.addAnnotation(annotation3);
      }

      if (includeHandlers)
      {
        final Annotation handlerChainAnnotation = new Annotation("javax.jws.HandlerChain", constantPool) ;
        final StringMemberValue handlerValue = new StringMemberValue(constantPool) ;
        handlerValue.setValue("esb-jaxws-handlers.xml") ;
        handlerChainAnnotation.addMemberValue("file", handlerValue) ;
        attribute.addAnnotation(handlerChainAnnotation) ;
      }
     
      seiClass.getClassFile().addAttribute(attribute);
View Full Code Here

            this.constPool = constPool;
        }

        @Override
        public void visitStringMemberValue(StringMemberValue node) {
            array[index] = new StringMemberValue(node.getValue(), constPool);
        }
View Full Code Here

                    for (String paramName : types.keySet()) {
                        newAnnotations[i] = new Annotation[1];

                        newAnnotations[i][0] = new Annotation(WebParam.class.getName(), method.getMethodInfo()
                                .getConstPool());
                        newAnnotations[i][0].addMemberValue("name", new StringMemberValue(paramName, method
                                .getMethodInfo().getConstPool()));
                        i++;
                    }

                    ParameterAnnotationsAttribute newAnnotationsAttribute = new ParameterAnnotationsAttribute(
View Full Code Here

    // Create annotation if it does not exist
    Annotation a = annoAttr.getAnnotation(ResourceMetaData.class.getName());
    if (a == null) {
      a = new Annotation(ResourceMetaData.class.getName(), constPool);
      // Add a name, otherwise there will be none in the generated descriptor.
      a.addMemberValue("name", new StringMemberValue(
              ResourceMetaDataFactory.getDefaultName(aClazz), constPool));
    }

    // Update description from JavaDoc
    String doc = Util.getComponentDocumentation(aAST, aClazz.getName());
View Full Code Here

    boolean isEmpty = value.length() == 0;
    boolean isDefault = value.equals(aDefault);

    if (isEmpty || isDefault || aOverride) {
      if (aNewValue != null) {
        aAnnotation.addMemberValue(aName, new StringMemberValue(aNewValue, aConstPool));
        getLog().info("Enhanced component meta data [" + aName + "]");
      } else {
        getLog().info("No meta data [" + aName + "] found");
        aReportData.put(aClazz.getName(), "No meta data [" + aName + "] found");
      }
View Full Code Here

                    || a.getTypeName().equals(
                            org.apache.uima.fit.descriptor.ExternalResource.class.getName())
                    || a.getTypeName().equals("org.uimafit.descriptor.ConfigurationParameter")
                    || a.getTypeName().equals("org.uimafit.descriptor.ExternalResource")) {
              if (a.getMemberValue("description") == null) {
                a.addMemberValue("description", new StringMemberValue(pdesc, aCtClazz
                        .getClassFile().getConstPool()));
                getLog().info("Enhanced description of " + type + " [" + pname + "]");
                // Replace updated annotation
                annoAttr.addAnnotation(a);
              } else {
View Full Code Here

TOP

Related Classes of javassist.bytecode.annotation.StringMemberValue

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.