Package javax.ws.rs

Examples of javax.ws.rs.DefaultValue


        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


        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

    @Test
    public void testBuildParamWithDefault() throws Exception {
        HeaderParam ann =
            Temp.class.getMethod("setHeaderParamWithDefault", double.class)
                .getAnnotation(HeaderParam.class);
        DefaultValue dvAnn =
            Temp.class.getMethod("setHeaderParamWithDefault", double.class)
                .getAnnotation(DefaultValue.class);

        final Annotation[] annArray = new Annotation[] {ann, dvAnn};
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

        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

                                                          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

         
          params[i] = list.toArray(new UploadFile[]{});
        }
       
        String defaultValue = null;
        DefaultValue defaultValueAnn = this.getDefaultValueAnn(anns);
        if (defaultValueAnn != null)defaultValue = defaultValueAnn.value();
 
        paramValue = this.getQueryParamValue(fieldName, defaultValue);
 
        if (java.util.Date.class.isAssignableFrom(paramClass)) {
          params[i] = this.getDateParam(anns, paramValue[0]);
View Full Code Here

   }

   @Override
   public ValueInjector createParameterExtractor(Class injectTargetClass, AccessibleObject injectTarget, Class type, Type genericType, Annotation[] annotations, boolean useDefault, ResteasyProviderFactory providerFactory)
   {
      DefaultValue defaultValue = findAnnotation(annotations, DefaultValue.class);
      boolean encode = findAnnotation(annotations, Encoded.class) != null || injectTarget.isAnnotationPresent(Encoded.class) || type.isAnnotationPresent(Encoded.class);
      String defaultVal = null;
      if (defaultValue != null) defaultVal = defaultValue.value();

      QueryParam query;
      HeaderParam header;
      MatrixParam matrix;
      PathParam uriParam;
View Full Code Here

         Annotation[] annotations = parameter.getAnnotations();
         AccessibleObject injectTarget = parameter.getAccessibleObject();
         Class<?> type = parameter.getResourceClass().getClazz();

         parameter.encoded = findAnnotation(annotations, Encoded.class) != null || injectTarget.isAnnotationPresent(Encoded.class) || type.isAnnotationPresent(Encoded.class);
         DefaultValue defaultValue = findAnnotation(annotations, DefaultValue.class);
         if (defaultValue != null) parameter.defaultValue = defaultValue.value();

         QueryParam query;
         HeaderParam header;
         MatrixParam matrix;
         PathParam uriParam;
View Full Code Here

                            .getInputStream());
         }
         else if (isCookie)
         {
            CookieParam cookieParam = (CookieParam) annotation;
            DefaultValue defaultValue = FindAnnotation.findAnnotation(
                    annotations, DefaultValue.class);
            String defaultVal = null;
            if (defaultValue != null)
               defaultVal = defaultValue.value();

            return new CookieParamInjector(type, genericType, method,
                    cookieParam.value(), defaultVal, annotations, factory).inject(request,
                    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.