/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the supplied provider. * * Any exceptions will be logged at finer level. * * @param provider message body writer on which the {@code isWriteable} should be invoked. * @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 static boolean isWriteable( final MessageBodyWriter<?> provider, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType) { try { return provider.isWriteable(type, genericType, annotations, mediaType); } catch (final Exception ex) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, LocalizationMessages.ERROR_MBW_ISWRITABLE(provider.getClass().getName()), ex); } } return false; }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the supplied provider. * * Any exceptions will be logged at finer level. * * @param provider message body writer on which the {@code isWriteable} should be invoked. * @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 static boolean isWriteable( final MessageBodyWriter<?> provider, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType) { try { return provider.isWriteable(type, genericType, annotations, mediaType); } catch (final Exception ex) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, LocalizationMessages.ERROR_MBW_ISWRITABLE(provider.getClass().getName()), ex); } } return false; }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the supplied provider. * * Any exceptions will be logged at finer level. * * @param provider message body writer on which the {@code isWriteable} should be invoked. * @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 static boolean isWriteable( final MessageBodyWriter<?> provider, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType) { try { return provider.isWriteable(type, genericType, annotations, mediaType); } catch (final Exception ex) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, LocalizationMessages.ERROR_MBW_ISWRITABLE(provider.getClass().getName()), ex); } } return false; }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the supplied provider. * * Any exceptions will be logged at finer level. * * @param provider message body writer on which the {@code isWriteable} should be invoked. * @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 static boolean isWriteable( final MessageBodyWriter<?> provider, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType) { try { return provider.isWriteable(type, genericType, annotations, mediaType); } catch (final Exception ex) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, LocalizationMessages.ERROR_MBW_ISWRITABLE(provider.getClass().getName()), ex); } } return false; }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the supplied provider. * * Any exceptions will be logged at finer level. * * @param provider message body writer on which the {@code isWriteable} should be invoked. * @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 static boolean isWriteable( final MessageBodyWriter<?> provider, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType) { try { return provider.isWriteable(type, genericType, annotations, mediaType); } catch (final Exception ex) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, LocalizationMessages.ERROR_MBW_ISWRITABLE(provider.getClass().getName()), ex); } } return false; }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the supplied provider. * * Any exceptions will be logged at finer level. * * @param provider message body writer on which the {@code isWriteable} should be invoked. * @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 static boolean isWriteable( final MessageBodyWriter<?> provider, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType) { try { return provider.isWriteable(type, genericType, annotations, mediaType); } catch (final Exception ex) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, LocalizationMessages.ERROR_MBW_ISWRITABLE(provider.getClass().getName()), ex); } } return false; }
/** * Safely invokes {@link javax.ws.rs.ext.MessageBodyWriter#isWriteable isWriteable} method on the supplied provider. * * Any exceptions will be logged at finer level. * * @param provider message body writer on which the {@code isWriteable} should be invoked. * @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 static boolean isWriteable( final MessageBodyWriter<?> provider, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType) { try { return provider.isWriteable(type, genericType, annotations, mediaType); } catch (final Exception ex) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, LocalizationMessages.ERROR_MBW_ISWRITABLE(provider.getClass().getName()), ex); } } return false; }