Package com.sun.codemodel

Examples of com.sun.codemodel.JAnnotationUse.param()


          xmlElementOriginalAnnotation = getAnnotation(candidate.getField(), xmlElementModelClass);

          // xmlElementOriginalAnnotation can be null:
          JExpression xmlName = getAnnotationMemberExpression(xmlElementOriginalAnnotation, "name");
          if (xmlName != null) {
            xmlElementAnnotation.param("name", xmlName);
          }
          else {
            xmlElementAnnotation.param("name", candidate.getFieldName());
          }
View Full Code Here


          JExpression xmlName = getAnnotationMemberExpression(xmlElementOriginalAnnotation, "name");
          if (xmlName != null) {
            xmlElementAnnotation.param("name", xmlName);
          }
          else {
            xmlElementAnnotation.param("name", candidate.getFieldName());
          }

          JExpression xmlNamespace = getAnnotationMemberExpression(xmlElementOriginalAnnotation, "namespace");
          if (xmlNamespace != null) {
            xmlElementAnnotation.param("namespace", xmlNamespace);
View Full Code Here

            xmlElementAnnotation.param("name", candidate.getFieldName());
          }

          JExpression xmlNamespace = getAnnotationMemberExpression(xmlElementOriginalAnnotation, "namespace");
          if (xmlNamespace != null) {
            xmlElementAnnotation.param("namespace", xmlNamespace);
          }
          else if (candidate.getFieldTargetNamespace() != null) {
            xmlElementAnnotation.param("namespace", candidate.getFieldTargetNamespace());
          }
View Full Code Here

          JExpression xmlNamespace = getAnnotationMemberExpression(xmlElementOriginalAnnotation, "namespace");
          if (xmlNamespace != null) {
            xmlElementAnnotation.param("namespace", xmlNamespace);
          }
          else if (candidate.getFieldTargetNamespace() != null) {
            xmlElementAnnotation.param("namespace", candidate.getFieldTargetNamespace());
          }

          JExpression type = getAnnotationMemberExpression(xmlElementOriginalAnnotation, "type");
          if (type != null) {
            xmlElementAnnotation.param("type", type);
View Full Code Here

            xmlElementAnnotation.param("namespace", candidate.getFieldTargetNamespace());
          }

          JExpression type = getAnnotationMemberExpression(xmlElementOriginalAnnotation, "type");
          if (type != null) {
            xmlElementAnnotation.param("type", type);
          }
        }

        JAnnotationUse adapterAnnotation = getAnnotation(candidate.getField(), xmlJavaTypeAdapterModelClass);
View Full Code Here

        if (ruleFactory.getGenerationConfig().isIncludeJsr303Annotations()) {

            if (node.has("minimum")) {
                JAnnotationUse annotation = field.annotate(DecimalMin.class);
                annotation.param("value", node.get("minimum").asText());
            }

            if (node.has("maximum")) {
                JAnnotationUse annotation = field.annotate(DecimalMax.class);
                annotation.param("value", node.get("maximum").asText());
View Full Code Here

                annotation.param("value", node.get("minimum").asText());
            }

            if (node.has("maximum")) {
                JAnnotationUse annotation = field.annotate(DecimalMax.class);
                annotation.param("value", node.get("maximum").asText());
            }

        }

        return field;
View Full Code Here

                && (node.has("minLength") || node.has("maxLength"))) {

            JAnnotationUse annotation = field.annotate(Size.class);

            if (node.has("minLength")) {
                annotation.param("min", node.get("minLength").asInt());
            }

            if (node.has("maxLength")) {
                annotation.param("max", node.get("maxLength").asInt());
            }
View Full Code Here

            if (node.has("minLength")) {
                annotation.param("min", node.get("minLength").asInt());
            }

            if (node.has("maxLength")) {
                annotation.param("max", node.get("maxLength").asInt());
            }
        }

        return field;
    }
View Full Code Here

        }
    }

    private void addGeneratedAnnotation(JDefinedClass jclass) {
        JAnnotationUse generated = jclass.annotate(Generated.class);
        generated.param("value", SchemaMapper.class.getPackage().getName());
    }

    private String getEnumName(String nodeName) {
        String className = ruleFactory.getNameHelper().replaceIllegalCharacters(capitalize(nodeName));
        return ruleFactory.getNameHelper().normalizeName(className);
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.