lombok-pg -

lombok
Annotation Type Rethrows


@Target(value=METHOD)
@Retention(value=SOURCE)
public @interface Rethrows

Helps defining complex Rethrow statements.

With lombok:

 @Rethrows({
   @Rethrow(IOException.class),
   @Rethrow(value=NullPointerException.class,as=IllegalArgumentException.class)
 })
 void testMethod(Object arg) {
   // do something
 }
 
 void testMethod() throw IOException as RuntimeException, NullPointerException as IllegalArgumentException {
   // do something
 }
 
Vanilla Java:
 void testMethod(Object arg) {
        try {
                // do something
        } catch (IOException e1) {
                throw new RuntimeException(e1);
        } catch (NullPointerException e2) {
                throw new IllegalArgumentException(e2);
        }
 }
 


Required Element Summary
 Rethrow[] value
           
 

Element Detail

value

public abstract Rethrow[] value

lombok-pg -

Copyright © 2010-2011 Philipp Eichhorn, licensed under the MIT licence.