@Override public Appendable append( CharSequence csq ) { try { return _appendable.append( csq ); } catch( IOException e ) { throw ManExceptionUtil.unchecked( e ); } }
/** * Throws an unchecked exception without having to declare or catch it. * * @param t Any exception * @return The {@link RuntimeException} return type is here so you can do this:<br> * {@code throw ManExceptionUtil.uncheck(new SomeException())} */ public static RuntimeException unchecked( Throwable t ) { _unchecked( t ); // above statement always throws, this is unreachable throw new IllegalStateException(); }
public Object get( Object receiver ) { try { return _field.get( receiver ); } catch( Exception e ) { throw ManExceptionUtil.unchecked( e ); } }
@Override public Appendable append( CharSequence csq ) { try { return _appendable.append( csq ); } catch( IOException e ) { throw ManExceptionUtil.unchecked( e ); } }
public Object get() { try { return _field.get( _receiver ); } catch( Exception e ) { throw ManExceptionUtil.unchecked( e ); } }
@Override public Appendable append( CharSequence csq, int start, int end ) { try { return _appendable.append( csq, start, end ); } catch( IOException e ) { throw ManExceptionUtil.unchecked( e ); } }
@Override public Appendable append( char c ) { try { return _appendable.append( c ); } catch( IOException e ) { throw ManExceptionUtil.unchecked( e ); } } }
public Object getStatic() { try { return _field.get( null ); } catch( Exception e ) { throw ManExceptionUtil.unchecked( e ); } }
public Object newInstance( Object... args ) { try { return _constructor.newInstance( args ); } catch( Exception e ) { throw ManExceptionUtil.unchecked( e ); } } }
@Override public Appendable append( CharSequence csq, int start, int end ) { try { return _appendable.append( csq, start, end ); } catch( IOException e ) { throw ManExceptionUtil.unchecked( e ); } }
@Override public Appendable append( char c ) { try { return _appendable.append( c ); } catch( IOException e ) { throw ManExceptionUtil.unchecked( e ); } } }
public void set( Object receiver, Object value ) { try { _field.set( receiver, value ); } catch( Exception e ) { if( setFinal( _field, receiver, value ) ) { return; } throw ManExceptionUtil.unchecked( e ); } }
public void setStatic( Object value ) { try { _field.set( null, value ); } catch( Exception e ) { if( setFinal( _field, value ) ) { return; } throw ManExceptionUtil.unchecked( e ); } } }
public void set( Object value ) { try { _field.set( _receiver, value ); } catch( Exception e ) { if( setFinal( _field, _receiver, value ) ) { return; } throw ManExceptionUtil.unchecked( e ); } } }
private void throwUnchecked( Exception e, StackTraceElement[] currentStack ) { e.setStackTrace( currentStack ); throw ManExceptionUtil.unchecked( e ); }
private void throwUnchecked( Exception e, StackTraceElement[] currentStack ) { e.setStackTrace( currentStack ); throw ManExceptionUtil.unchecked( e ); }
private static boolean setFinal( Field field, Object ctx, Object value ) { if( Modifier.isFinal( field.getModifiers() ) ) { try { clearFieldAccessors( field ); removeFinalModifier( field ); field.set( ctx, value ); return true; } catch( Exception e ) { throw ManExceptionUtil.unchecked( e ); } } return false; }