Package javax.ws.rs

Examples of javax.ws.rs.DefaultValue


                setOptionalAttribute(element, "required", required, "false");
                String allowedValues = apiParam.allowableValues();
                setOptionalAttribute(element, "allowableValues", allowedValues, "all");
            }
            String defaultValue;
            DefaultValue dva = paramElement.getAnnotation(DefaultValue.class);
            if (dva!=null)
                defaultValue = dva.value();
            else if (ap!=null)
                defaultValue = ap.defaultValue();
            else
                defaultValue = "-none-";
View Full Code Here


        return null;
    }

    public static String getDefaultParameterValue(Annotation[] anns) {

        DefaultValue dv = AnnotationUtils.getAnnotation(anns, DefaultValue.class);
        return dv != null ? dv.value() : null;
    }
View Full Code Here

  }
 
  private static String getDefaultValue(Annotation[] annotations) {
    for (Annotation annotation : annotations) {
      if(annotation.annotationType().equals(DefaultValue.class)){
        DefaultValue dv = (DefaultValue) annotation;
        return dv.value();
      }
    }
    return null;
  }
View Full Code Here

                                                          Encoded.class) != null;
        }
    }
   
    private void checkDefaultParameterValue() {
        DefaultValue dv = (DefaultValue)AnnotationUtils.getMethodAnnotation(annotatedMethod,
                                            DefaultValue.class);
        if (dv == null && classResourceInfo != null) {
            dv = (DefaultValue)AnnotationUtils.getClassAnnotation(
                                         classResourceInfo.getServiceClass(),
                                         DefaultValue.class);
        }
        if (dv != null) {
            defaultParamValue = dv.value();
        }
    }
View Full Code Here

            p.setType(new QName(XML_SCHEMA_NS, "byte"));
        }

        for (Annotation a : annotations) {
            if (DefaultValue.class.equals(a.annotationType())) {
                DefaultValue paramAnn = (DefaultValue)a;
                p.setDefault(paramAnn.value());
            }

            if (WADLDoc.class.equals(a.annotationType())) {
                WADLDoc d = (WADLDoc)a;
                p.getDoc().add(getDocument(d));
View Full Code Here

        return null;
    }
   
    public static String getDefaultParameterValue(Annotation[] anns) {
       
        DefaultValue dv = AnnotationUtils.getAnnotation(anns, DefaultValue.class);
        return dv != null ? dv.value() : null;
       
    }
View Full Code Here

                                parameter.isAnnotationPresent(DefaultValue.class)) {
                                mustPatch = true;
                            }

                            boolean encoded = parameter.isAnnotationPresent(Encoded.class) || methodHasEncodedAnnotation || classHasEncodedAnnotation;
                            DefaultValue defaultValue = parameter.getAnnotation(DefaultValue.class);
                            if (defaultValue != null) {
                                mustPatch = true;
                            }
                            DiscoveredParameter jerseyParameter = new DiscoveredParameter(annotation, parameter.getBaseType(), defaultValue, encoded);
                            discovered.add(jerseyParameter);
View Full Code Here

                                parameter.isAnnotationPresent(DefaultValue.class)) {
                                mustPatch = true;
                            }

                            boolean encoded = parameter.isAnnotationPresent(Encoded.class) || methodHasEncodedAnnotation || classHasEncodedAnnotation;
                            DefaultValue defaultValue = parameter.getAnnotation(DefaultValue.class);
                            if (defaultValue != null) {
                                mustPatch = true;
                            }
                            DiscoveredParameter jerseyParameter = new DiscoveredParameter(annotation, parameter.getBaseType(), defaultValue, encoded);
                            discovered.add(jerseyParameter);
                            LOGGER.fine("  recorded " + jerseyParameter);
                            parameterToPatchInfoMap.put(parameter, new PatchInformation(jerseyParameter, getSyntheticQualifierFor(jerseyParameter), false));
                        }
                    }
                }
            }
        }
        else {
            // a method *not* annotated with @Inject -- here we only deal with
            // setter methods with a JAX-RS "qualifier" (Context, QueryParam, etc.)
            // on the method itself
            if (isSetterMethod(method)) {
                boolean methodHasEncodedAnnotation = method.isAnnotationPresent(Encoded.class);
                for (Annotation annotation : method.getAnnotations()) {
                    Set<DiscoveredParameter> discovered = discoveredParameterMap.get(annotation.annotationType());
                    if (discovered != null) {
                        if (knownParameterQualifiers.contains(annotation.annotationType())) {
                            mustPatch = true;
                            setterMethodsWithoutInject.add(method);
                            for (AnnotatedParameter<? super T> parameter : method.getParameters()) {
                                boolean encoded = parameter.isAnnotationPresent(Encoded.class) || methodHasEncodedAnnotation || classHasEncodedAnnotation;
                                DefaultValue defaultValue = parameter.getAnnotation(DefaultValue.class);
                                if (defaultValue == null) {
                                    defaultValue = method.getAnnotation(DefaultValue.class);
                                }
                                DiscoveredParameter jerseyParameter = new DiscoveredParameter(annotation, parameter.getBaseType(), defaultValue, encoded);
                                discovered.add(jerseyParameter);
View Full Code Here

                }

                Set<DiscoveredParameter> discovered = discoveredParameterMap.get(annotation.annotationType());
                if (discovered != null) {
                    boolean encoded = field.isAnnotationPresent(Encoded.class) || classHasEncodedAnnotation;
                    DefaultValue defaultValue = field.getAnnotation(DefaultValue.class);
                    DiscoveredParameter parameter = new DiscoveredParameter(annotation, field.getBaseType(), defaultValue, encoded);
                    discovered.add(parameter);
                    LOGGER.fine("  recorded " + parameter);
                    fieldToPatchInfoMap.put(field, new PatchInformation(parameter, getSyntheticQualifierFor(parameter), mustAddInjectAnnotation));
                }
View Full Code Here

        return ori.isEncodedEnabled();
    }
   
    public static String getDefaultParameterValue(Annotation[] anns, OperationResourceInfo ori) {
       
        DefaultValue dv = AnnotationUtils.getAnnotation(anns, DefaultValue.class);
        if (dv != null) {
            return dv.value();
        }
       
        if (ori == null) {
            return null;
        }
View Full Code Here

TOP

Related Classes of javax.ws.rs.DefaultValue

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.