/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance that is to be written. * @param genericType the type of instance to be written, obtained either * by reflection of a resource method return type or via inspection * of the returned instance. {@link javax.ws.rs.core.GenericEntity} * provides a way to specify this information at runtime. * @param annotations an array of the annotations attached to the message entity instance. * @param mediaType the media type of the HTTP entity. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isWriteable(super.provider(), type, genericType, annotations, mediaType); } }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance that is to be written. * @param genericType the type of instance to be written, obtained either * by reflection of a resource method return type or via inspection * of the returned instance. {@link javax.ws.rs.core.GenericEntity} * provides a way to specify this information at runtime. * @param annotations an array of the annotations attached to the message entity instance. * @param mediaType the media type of the HTTP entity. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isWriteable(super.provider(), type, genericType, annotations, mediaType); } }
@SuppressWarnings("unchecked") private <T> MessageBodyWriter<T> _getMessageBodyWriter(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyWriter> writers = writersCache.get(lookup); if (writers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyWriter<T> selected = null; final Iterator<MessageBodyWriter> iterator = writers.iterator(); while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); if (isWriteable(p, c, t, as, mediaType)) { selected = (MessageBodyWriter<T>) p; tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBW_NOT_WRITEABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, p); } } return selected; }
@SuppressWarnings("unchecked") private <T> MessageBodyWriter<T> _getMessageBodyWriter(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyWriter> writers = writersCache.get(lookup); if (writers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyWriter<T> selected = null; final Iterator<MessageBodyWriter> iterator = writers.iterator(); while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); if (isWriteable(p, c, t, as, mediaType)) { selected = (MessageBodyWriter<T>) p; tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBW_NOT_WRITEABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, p); } } return selected; }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance that is to be written. * @param genericType the type of instance to be written, obtained either * by reflection of a resource method return type or via inspection * of the returned instance. {@link javax.ws.rs.core.GenericEntity} * provides a way to specify this information at runtime. * @param annotations an array of the annotations attached to the message entity instance. * @param mediaType the media type of the HTTP entity. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isWriteable(super.provider(), type, genericType, annotations, mediaType); } }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance that is to be written. * @param genericType the type of instance to be written, obtained either * by reflection of a resource method return type or via inspection * of the returned instance. {@link javax.ws.rs.core.GenericEntity} * provides a way to specify this information at runtime. * @param annotations an array of the annotations attached to the message entity instance. * @param mediaType the media type of the HTTP entity. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isWriteable(super.provider(), type, genericType, annotations, mediaType); } }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance that is to be written. * @param genericType the type of instance to be written, obtained either * by reflection of a resource method return type or via inspection * of the returned instance. {@link javax.ws.rs.core.GenericEntity} * provides a way to specify this information at runtime. * @param annotations an array of the annotations attached to the message entity instance. * @param mediaType the media type of the HTTP entity. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isWriteable(super.provider(), type, genericType, annotations, mediaType); } }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance that is to be written. * @param genericType the type of instance to be written, obtained either * by reflection of a resource method return type or via inspection * of the returned instance. {@link javax.ws.rs.core.GenericEntity} * provides a way to specify this information at runtime. * @param annotations an array of the annotations attached to the message entity instance. * @param mediaType the media type of the HTTP entity. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isWriteable(super.provider(), type, genericType, annotations, mediaType); } }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the underlying provider. * * Any exceptions will be logged at finer level. * * @param type the class of instance that is to be written. * @param genericType the type of instance to be written, obtained either * by reflection of a resource method return type or via inspection * of the returned instance. {@link javax.ws.rs.core.GenericEntity} * provides a way to specify this information at runtime. * @param annotations an array of the annotations attached to the message entity instance. * @param mediaType the media type of the HTTP entity. * @return {@code true} if the type is supported, otherwise {@code false}. */ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return MessageBodyFactory.isWriteable(super.provider(), type, genericType, annotations, mediaType); } }
@SuppressWarnings("unchecked") private <T> MessageBodyWriter<T> _getMessageBodyWriter(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyWriter> writers = writersCache.get(lookup); if (writers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyWriter<T> selected = null; final Iterator<MessageBodyWriter> iterator = writers.iterator(); while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); if (isWriteable(p, c, t, as, mediaType)) { selected = (MessageBodyWriter<T>) p; tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBW_NOT_WRITEABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, p); } } return selected; }
@SuppressWarnings("unchecked") private <T> MessageBodyWriter<T> _getMessageBodyWriter(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyWriter> writers = writersCache.get(lookup); if (writers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyWriter<T> selected = null; final Iterator<MessageBodyWriter> iterator = writers.iterator(); while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); if (isWriteable(p, c, t, as, mediaType)) { selected = (MessageBodyWriter<T>) p; tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBW_NOT_WRITEABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, p); } } return selected; }
@SuppressWarnings("unchecked") private <T> MessageBodyWriter<T> _getMessageBodyWriter(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyWriter> writers = writersCache.get(lookup); if (writers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyWriter<T> selected = null; final Iterator<MessageBodyWriter> iterator = writers.iterator(); while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); if (isWriteable(p, c, t, as, mediaType)) { selected = (MessageBodyWriter<T>) p; tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBW_NOT_WRITEABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, p); } } return selected; }
@SuppressWarnings("unchecked") private <T> MessageBodyWriter<T> _getMessageBodyWriter(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyWriter> writers = writersCache.get(lookup); if (writers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyWriter<T> selected = null; final Iterator<MessageBodyWriter> iterator = writers.iterator(); while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); if (isWriteable(p, c, t, as, mediaType)) { selected = (MessageBodyWriter<T>) p; tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBW_NOT_WRITEABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, p); } } return selected; }
@SuppressWarnings("unchecked") private <T> MessageBodyWriter<T> _getMessageBodyWriter(final Class<T> c, final Type t, final Annotation[] as, final MediaType mediaType, final MediaType lookup, final PropertiesDelegate propertiesDelegate) { final List<MessageBodyWriter> writers = writersCache.get(lookup); if (writers == null) { return null; } final TracingLogger tracingLogger = TracingLogger.getInstance(propertiesDelegate); MessageBodyWriter<T> selected = null; final Iterator<MessageBodyWriter> iterator = writers.iterator(); while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); if (isWriteable(p, c, t, as, mediaType)) { selected = (MessageBodyWriter<T>) p; tracingLogger.log(MsgTraceEvent.MBW_SELECTED, selected); break; } tracingLogger.log(MsgTraceEvent.MBW_NOT_WRITEABLE, p); } if (tracingLogger.isLogEnabled(MsgTraceEvent.MBW_SKIPPED)) { while (iterator.hasNext()) { final MessageBodyWriter p = iterator.next(); tracingLogger.log(MsgTraceEvent.MBW_SKIPPED, p); } } return selected; }