paramEncoded = true; } else if (DefaultValue.class == annotation.annotationType()) { paramDefault = ((DefaultValue) annotation).value(); } else {
paramEncoded = true; } else if (DefaultValue.class == annotation.annotationType()) { paramDefault = ((DefaultValue) annotation).value(); } else {
paramEncoded = true; } else if (DefaultValue.class == annotation.annotationType()) { paramDefault = ((DefaultValue) annotation).value(); } else {
} else { if (value == null && (ann = anns.get(DefaultValue.class)) != null) { value = ((DefaultValue) ann).value();
/** * Generate a swagger parameter according to {@code annotations} and {@code genericType}. * * @param operationGenerator operationGenerator * @param annotations annotations on fields or setter methods * @param genericType type of the fields, or the param type of the setter methods * @return a swagger param, or null if there is no JAX-RS annotation in {@code annotations} */ private Parameter generateSwaggerParam( OperationGenerator operationGenerator, Annotation[] annotations, Type genericType) { String defaultValue = null; for (Annotation fieldAnnotation : annotations) { if (!SUPPORTED_PARAM_ANNOTATIONS.contains(fieldAnnotation.annotationType())) { if (fieldAnnotation instanceof DefaultValue) { defaultValue = ((DefaultValue) fieldAnnotation).value(); } continue; } return setUpParameter(operationGenerator, fieldAnnotation, genericType, defaultValue); } return null; }
defaultValue = ((DefaultValue) annotation).value(); } else { ParameterAnnotationProcessor processor =
paramEncoded = true; } else if (DefaultValue.class == annotation.annotationType()) { paramDefault = ((DefaultValue) annotation).value(); } else {
private List<Parameter> extractParametersFromAnnotation(Type type, ClassToInstanceMap<Annotation> annotations) { String defaultValue = ""; if (annotations.containsKey(DefaultValue.class)) { DefaultValue defaultValueAnnotation = annotations.getInstance(DefaultValue.class); defaultValue = defaultValueAnnotation.value(); } List<Parameter> parameters = new ArrayList<>(); if (annotations.containsKey(QueryParam.class)) { QueryParam param = annotations.getInstance(QueryParam.class); QueryParameter queryParameter = extractQueryParam(type, defaultValue, param); parameters.add(queryParameter); } else if (annotations.containsKey(PathParam.class)) { PathParam param = annotations.getInstance(PathParam.class); PathParameter pathParameter = extractPathParam(type, defaultValue, param); parameters.add(pathParameter); } else if (annotations.containsKey(HeaderParam.class)) { HeaderParam param = annotations.getInstance(HeaderParam.class); HeaderParameter headerParameter = extractHeaderParam(type, defaultValue, param); parameters.add(headerParameter); } else if (annotations.containsKey(CookieParam.class)) { CookieParam param = annotations.getInstance(CookieParam.class); CookieParameter cookieParameter = extractCookieParameter(type, defaultValue, param); parameters.add(cookieParameter); } else if (annotations.containsKey(FormParam.class)) { FormParam param = annotations.getInstance(FormParam.class); FormParameter formParameter = extractFormParameter(type, defaultValue, param); parameters.add(formParameter); } return parameters; }
String defaultVal = null; if (defaultValue != null) defaultVal = defaultValue.value();
private String getDefaultValue(Method method) { DefaultValue defaultValueAnn = method.getAnnotation(DefaultValue.class); if (defaultValueAnn != null) { return defaultValueAnn.value(); } return null; }
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; }
public static String getDefaultParameterValue(Annotation[] anns) { DefaultValue dv = AnnotationUtils.getAnnotation(anns, DefaultValue.class); return dv != null ? dv.value() : null; }
public String getDefaultValue() { DefaultValue annotation = getAnnotation(DefaultValue.class); if (annotation != null) return annotation.value(); else return null; }
@Override public String defaultValue() { try { DefaultValue defaultValue = parameter.getAnnotation(DefaultValue.class); return defaultValue.value(); } catch (NullPointerException e) {} // TODO Auto-generated method stub return null; } @Override
public static String getDefaultParameterValue(Annotation[] anns) { DefaultValue dv = AnnotationUtils.getAnnotation(anns, DefaultValue.class); return dv != null ? dv.value() : null; }
DefaultValue defaultValue = findAnnotation(annotations, DefaultValue.class); if (defaultValue != null) parameter.defaultValue = defaultValue.value();
private void checkDefaultParameterValue() { DefaultValue dv = AnnotationUtils.getMethodAnnotation(annotatedMethod, DefaultValue.class); if (dv == null && classResourceInfo != null) { dv = AnnotationUtils.getClassAnnotation( classResourceInfo.getServiceClass(), DefaultValue.class); } if (dv != null) { defaultParamValue = dv.value(); } } public Annotation[][] getInParameterAnnotations() {
boolean encode = findAnnotation(annotations, Encoded.class) != null || injectTarget.isAnnotationPresent(Encoded.class) || type.isAnnotationPresent(Encoded.class); String defaultVal = null; if (defaultValue != null) defaultVal = defaultValue.value();
@Override public T get() { final MinijaxRequestContext context = MinijaxRequestContext.getThreadLocal(); String value = context.getUriInfo().getQueryParameters().getFirst(key.getName()); if (value == null && key.getDefaultValue() != null) { value = key.getDefaultValue().value(); } return context.getApplication().convertParamToType(value, key.getType(), key.getAnnotations()); } }