/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyReader#isReadable isReadable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance to be produced. * @param genericType the type of instance 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 Method.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 Method.getParameterAnnotations}. * @param mediaType the media type of the HTTP entity, if one is not * specified in the request then {@code application/octet-stream} is * used. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isReadable(super.provider(), type, genericType, annotations, mediaType); } }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyReader#isReadable isReadable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance to be produced. * @param genericType the type of instance 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 Method.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 Method.getParameterAnnotations}. * @param mediaType the media type of the HTTP entity, if one is not * specified in the request then {@code application/octet-stream} is * used. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isReadable(super.provider(), type, genericType, annotations, mediaType); } }
@SuppressWarnings("unchecked") private <T> MessageBodyReader<T> _getMessageBodyReader(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyReader> readers = readersCache.get(lookup); if (readers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyReader<T> selected = null; final Iterator<MessageBodyReader> iterator = readers.iterator(); while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); if (isReadable(p, c, t, as, mediaType)) { selected = (MessageBodyReader<T>) p; tracingLogger.log(MsgTraceEvent.MBR_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBR_NOT_READABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBR_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBR_SKIPPED, p); } } return selected; }
@SuppressWarnings("unchecked") private <T> MessageBodyReader<T> _getMessageBodyReader(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyReader> readers = readersCache.get(lookup); if (readers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyReader<T> selected = null; final Iterator<MessageBodyReader> iterator = readers.iterator(); while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); if (isReadable(p, c, t, as, mediaType)) { selected = (MessageBodyReader<T>) p; tracingLogger.log(MsgTraceEvent.MBR_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBR_NOT_READABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBR_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBR_SKIPPED, p); } } return selected; }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyReader#isReadable isReadable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance to be produced. * @param genericType the type of instance 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 Method.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 Method.getParameterAnnotations}. * @param mediaType the media type of the HTTP entity, if one is not * specified in the request then {@code application/octet-stream} is * used. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isReadable(super.provider(), type, genericType, annotations, mediaType); } }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyReader#isReadable isReadable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance to be produced. * @param genericType the type of instance 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 Method.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 Method.getParameterAnnotations}. * @param mediaType the media type of the HTTP entity, if one is not * specified in the request then {@code application/octet-stream} is * used. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isReadable(super.provider(), type, genericType, annotations, mediaType); } }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyReader#isReadable isReadable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance to be produced. * @param genericType the type of instance 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 Method.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 Method.getParameterAnnotations}. * @param mediaType the media type of the HTTP entity, if one is not * specified in the request then {@code application/octet-stream} is * used. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isReadable(super.provider(), type, genericType, annotations, mediaType); } }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyReader#isReadable isReadable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance to be produced. * @param genericType the type of instance 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 Method.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 Method.getParameterAnnotations}. * @param mediaType the media type of the HTTP entity, if one is not * specified in the request then {@code application/octet-stream} is * used. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isReadable(super.provider(), type, genericType, annotations, mediaType); } }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyReader#isReadable isReadable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance to be produced. * @param genericType the type of instance 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 Method.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 Method.getParameterAnnotations}. * @param mediaType the media type of the HTTP entity, if one is not * specified in the request then {@code application/octet-stream} is * used. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isReadable(super.provider(), type, genericType, annotations, mediaType); } }
@SuppressWarnings("unchecked") private <T> MessageBodyReader<T> _getMessageBodyReader(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyReader> readers = readersCache.get(lookup); if (readers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyReader<T> selected = null; final Iterator<MessageBodyReader> iterator = readers.iterator(); while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); if (isReadable(p, c, t, as, mediaType)) { selected = (MessageBodyReader<T>) p; tracingLogger.log(MsgTraceEvent.MBR_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBR_NOT_READABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBR_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBR_SKIPPED, p); } } return selected; }
@SuppressWarnings("unchecked") private <T> MessageBodyReader<T> _getMessageBodyReader(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyReader> readers = readersCache.get(lookup); if (readers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyReader<T> selected = null; final Iterator<MessageBodyReader> iterator = readers.iterator(); while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); if (isReadable(p, c, t, as, mediaType)) { selected = (MessageBodyReader<T>) p; tracingLogger.log(MsgTraceEvent.MBR_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBR_NOT_READABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBR_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBR_SKIPPED, p); } } return selected; }
@SuppressWarnings("unchecked") private <T> MessageBodyReader<T> _getMessageBodyReader(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyReader> readers = readersCache.get(lookup); if (readers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyReader<T> selected = null; final Iterator<MessageBodyReader> iterator = readers.iterator(); while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); if (isReadable(p, c, t, as, mediaType)) { selected = (MessageBodyReader<T>) p; tracingLogger.log(MsgTraceEvent.MBR_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBR_NOT_READABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBR_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBR_SKIPPED, p); } } return selected; }
@SuppressWarnings("unchecked") private <T> MessageBodyReader<T> _getMessageBodyReader(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyReader> readers = readersCache.get(lookup); if (readers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyReader<T> selected = null; final Iterator<MessageBodyReader> iterator = readers.iterator(); while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); if (isReadable(p, c, t, as, mediaType)) { selected = (MessageBodyReader<T>) p; tracingLogger.log(MsgTraceEvent.MBR_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBR_NOT_READABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBR_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBR_SKIPPED, p); } } return selected; }
@SuppressWarnings("unchecked") private <T> MessageBodyReader<T> _getMessageBodyReader(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyReader> readers = readersCache.get(lookup); if (readers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyReader<T> selected = null; final Iterator<MessageBodyReader> iterator = readers.iterator(); while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); if (isReadable(p, c, t, as, mediaType)) { selected = (MessageBodyReader<T>) p; tracingLogger.log(MsgTraceEvent.MBR_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBR_NOT_READABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBR_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyReader p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBR_SKIPPED, p); } } return selected; }