private MediaTypeMap<SortedKey<MessageBodyReader>> getServerMessageBodyReaders() { if (serverMessageBodyReaders == null && parent != null) return parent.getServerMessageBodyReaders(); return serverMessageBodyReaders; }
public <T> MessageBodyReader<T> getServerMessageBodyReader(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType, RESTEasyTracingLogger tracingLogger) { MediaTypeMap<SortedKey<MessageBodyReader>> availableReaders = getServerMessageBodyReaders(); return resolveMessageBodyReader(type, genericType, annotations, mediaType, availableReaders, tracingLogger); }
@Deprecated public <T> MessageBodyReader<T> getServerMessageBodyReader(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType) { MediaTypeMap<SortedKey<MessageBodyReader>> availableReaders = getServerMessageBodyReaders(); return resolveMessageBodyReader(type, genericType, annotations, mediaType, availableReaders); }
/** * Always returns server MBRs. * * @param type the class of the object that is to be read. * @param genericType the type of object to be produced. E.g. if the * message body is to be converted into a method parameter, this will be * the formal type of the method parameter as returned by * {@code Class.getGenericParameterTypes}. * @param annotations an array of the annotations on the declaration of the * artifact that will be initialized with the produced instance. E.g. if * the message body is to be converted into a method parameter, this will * be the annotations on that parameter returned by * {@code Class.getParameterAnnotations}. * @param mediaType the media type of the data that will be read. * @param <T> type * @return message reader */ public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType) { MediaTypeMap<SortedKey<MessageBodyReader>> availableReaders = getServerMessageBodyReaders(); MessageBodyReader<T> reader = resolveMessageBodyReader(type, genericType, annotations, mediaType, availableReaders); if (reader != null) LogMessages.LOGGER.debugf("MessageBodyReader: %s", reader.getClass().getName()); return reader; }
providerInstances = parent == null ? new CopyOnWriteArraySet<>() : new CopyOnWriteArraySet<>(parent.getProviderInstances()); classContracts = parent == null ? new ConcurrentHashMap<>() : new ConcurrentHashMap<>(parent.getClassContracts()); serverMessageBodyReaders = parent == null ? new MediaTypeMap<>() : parent.getServerMessageBodyReaders().clone(); serverMessageBodyWriters = parent == null ? new MediaTypeMap<>() : parent.getServerMessageBodyWriters().clone(); clientMessageBodyReaders = parent == null ? new MediaTypeMap<>() : parent.getClientMessageBodyReaders().clone();
private MediaTypeMap<SortedKey<MessageBodyReader>> getServerMessageBodyReaders() { if (serverMessageBodyReaders == null && parent != null) return parent.getServerMessageBodyReaders(); return serverMessageBodyReaders; }
serverMessageBodyReaders = parent.getServerMessageBodyReaders().clone();
public <T> MessageBodyReader<T> getServerMessageBodyReader(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType, RESTEasyTracingLogger tracingLogger) { MediaTypeMap<SortedKey<MessageBodyReader>> availableReaders = getServerMessageBodyReaders(); return resolveMessageBodyReader(type, genericType, annotations, mediaType, availableReaders, tracingLogger); }
@Deprecated public <T> MessageBodyReader<T> getServerMessageBodyReader(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType) { MediaTypeMap<SortedKey<MessageBodyReader>> availableReaders = getServerMessageBodyReaders(); return resolveMessageBodyReader(type, genericType, annotations, mediaType, availableReaders); }
/** * Always returns server MBRs. * * @param type the class of the object that is to be read. * @param genericType the type of object to be produced. E.g. if the * message body is to be converted into a method parameter, this will be * the formal type of the method parameter as returned by * {@code Class.getGenericParameterTypes}. * @param annotations an array of the annotations on the declaration of the * artifact that will be initialized with the produced instance. E.g. if * the message body is to be converted into a method parameter, this will * be the annotations on that parameter returned by * {@code Class.getParameterAnnotations}. * @param mediaType the media type of the data that will be read. * @param <T> type * @return message reader */ public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType) { MediaTypeMap<SortedKey<MessageBodyReader>> availableReaders = getServerMessageBodyReaders(); MessageBodyReader<T> reader = resolveMessageBodyReader(type, genericType, annotations, mediaType, availableReaders); if (reader != null) LogMessages.LOGGER.debugf("MessageBodyReader: %s", reader.getClass().getName()); return reader; }
providerInstances = parent == null ? new CopyOnWriteArraySet<>() : new CopyOnWriteArraySet<>(parent.getProviderInstances()); classContracts = parent == null ? new ConcurrentHashMap<>() : new ConcurrentHashMap<>(parent.getClassContracts()); serverMessageBodyReaders = parent == null ? new MediaTypeMap<>() : parent.getServerMessageBodyReaders().clone(); serverMessageBodyWriters = parent == null ? new MediaTypeMap<>() : parent.getServerMessageBodyWriters().clone(); clientMessageBodyReaders = parent == null ? new MediaTypeMap<>() : parent.getClientMessageBodyReaders().clone();
serverMessageBodyReaders = parent.getServerMessageBodyReaders().clone();