/** * Create an unmodifiable list of media types from the values declared in the {@link Consumes} * annotation. * * @param annotation the Consumes annotation. * @return the list of {@link MediaType}, ordered according to {@link #PARTIAL_ORDER_COMPARATOR}. */ public static List<MediaType> createFrom(Consumes annotation) { if (annotation == null) { return WILDCARD_TYPE_SINGLETON_LIST; } return createFrom(annotation.value()); }
/** * Create an unmodifiable list of media types from the values declared in the {@link Consumes} * annotation. * * @param annotation the Consumes annotation. * @return the list of {@link MediaType}, ordered according to {@link #PARTIAL_ORDER_COMPARATOR}. */ public static List<MediaType> createFrom(Consumes annotation) { if (annotation == null) { return WILDCARD_TYPE_SINGLETON_LIST; } return createFrom(annotation.value()); }
private static List<MediaType> extractMediaTypes(final Consumes annotation) { return (annotation != null) ? extractMediaTypes(annotation.value()) : Collections.<MediaType>emptyList(); }
private static List<MediaType> extractMediaTypes(final Consumes annotation) { return (annotation != null) ? extractMediaTypes(annotation.value()) : Collections.<MediaType>emptyList(); }
public static ContainerException badMethodConsumes(Exception e, Class resourceClass, Method m, Consumes c) { return new ContainerException(ImplMessages.BAD_METHOD_CONSUMEMIME(resourceClass, c.value(), m.toString()), e); }
protected Content processContent(Content content, Schema schema, Consumes methodConsumes, Consumes classConsumes) { if (content == null) { content = new Content(); } if (methodConsumes != null) { for (String value : methodConsumes.value()) { setMediaTypeToContent(schema, content, value); } } else if (classConsumes != null) { for (String value : classConsumes.value()) { setMediaTypeToContent(schema, content, value); } } else { setMediaTypeToContent(schema, content, DEFAULT_MEDIA_TYPE_VALUE); } return content; }
public static ContainerException badClassConsumes(Exception e, Class resourceClass, Consumes c) { return new ContainerException(ImplMessages.BAD_CLASS_CONSUMEMIME(resourceClass, c.value()), e); }
tmpAnnotations, components, classConsumes == null ? new String[0] : classConsumes.value(), null, jsonViewAnnotation);
return Optional.empty(); AnnotationsUtils.getContent(requestBody.content(), classConsumes == null ? new String[0] : classConsumes.value(), methodConsumes == null ? new String[0] : methodConsumes.value(), null, components, jsonViewAnnotation).ifPresent(requestBodyObject::setContent); return Optional.of(requestBodyObject);
paramAnnotations, components, classConsumes == null ? new String[0] : classConsumes.value(), methodConsumes == null ? new String[0] : methodConsumes.value(), jsonViewAnnotation); if (processedParam != null) { paramAnnotations, components, classConsumes == null ? new String[0] : classConsumes.value(), methodConsumes == null ? new String[0] : methodConsumes.value(), jsonViewAnnotation); if (processedParam != null) {
annotations, components, classConsumes == null ? new String[0] : classConsumes.value(), methodConsumes == null ? new String[0] : methodConsumes.value(), jsonViewAnnotation); if (unknownParameter != null) { if (StringUtils.isNotBlank(unknownParameter.getIn()) && !"form".equals(unknownParameter.getIn())) { annotations, components, classConsumes == null ? new String[0] : classConsumes.value(), methodConsumes == null ? new String[0] : methodConsumes.value(), jsonViewAnnotation); if (processedParameter != null) {
private static List<MediaType> extractMediaTypes(final Consumes annotation) { return (annotation != null) ? extractMediaTypes(annotation.value()) : Collections.<MediaType>emptyList(); }
@Override public void process(Object annotation, OperationGenerator operationGenerator) { Consumes consumes = (Consumes) annotation; List<String> consumeList = Arrays.stream(consumes.value()).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!consumeList.isEmpty()) { operationGenerator.getOperation().setConsumes(consumeList); } } }
@SuppressWarnings(value = "unchecked") public static MediaType getConsumes(Class declaring, AccessibleObject method) { Consumes consume = method.getAnnotation(Consumes.class); if (consume == null) { consume = (Consumes) declaring.getAnnotation(Consumes.class); if (consume == null) return null; } return MediaType.valueOf(consume.value()[0]); }
consumes = method.getDeclaringClass().getAnnotation(Consumes.class); if (consumes != null) resourceMethodBuilder.consumes(consumes.value());
apiConsumes = consumes.value();
for (String consume : consumeMime.value())