private static Charset getCharset(final Field field) { final Encoding annotation = field.getAnnotation(Encoding.class); try { return Charset.forName(annotation != null ? annotation.value() : "UTF-8"); //$NON-NLS-1$ } catch (final UnsupportedCharsetException exception) { logger.log(ILevel.ERROR, exception.getLocalizedMessage(), exception); return Charset.forName("UTF-8"); //$NON-NLS-1$ } catch (final IllegalCharsetNameException exception) { logger.log(ILevel.ERROR, exception.getLocalizedMessage(), exception); return Charset.forName("UTF-8"); //$NON-NLS-1$ } catch (final IllegalArgumentException exception) { logger.log(ILevel.ERROR, exception.getLocalizedMessage(), exception); return Charset.forName("UTF-8"); //$NON-NLS-1$ } } }
private static Charset getCharset(final Field field) { final Encoding annotation = field.getAnnotation(Encoding.class); try { return Charset.forName(annotation != null ? annotation.value() : "UTF-8"); //$NON-NLS-1$ } catch (final UnsupportedCharsetException exception) { logger.log(ILevel.ERROR, exception.getLocalizedMessage(), exception); return Charset.forName("UTF-8"); //$NON-NLS-1$ } catch (final IllegalCharsetNameException exception) { logger.log(ILevel.ERROR, exception.getLocalizedMessage(), exception); return Charset.forName("UTF-8"); //$NON-NLS-1$ } catch (final IllegalArgumentException exception) { logger.log(ILevel.ERROR, exception.getLocalizedMessage(), exception); return Charset.forName("UTF-8"); //$NON-NLS-1$ } } }
throw new UnsupportedCharsetException(icne.getLocalizedMessage());
throw new UnsupportedCharsetException(icne.getLocalizedMessage());