Skip to content

Instantly share code, notes, and snippets.

@soc
Created April 12, 2015 19:18
Show Gist options
  • Select an option

  • Save soc/66b68980c581d13882ad to your computer and use it in GitHub Desktop.

Select an option

Save soc/66b68980c581d13882ad to your computer and use it in GitHub Desktop.
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface Foo { }
//@Retention(value = RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@interface Val {
// Class clazz();
}
@interface Bla {
Class value();
Class clazz();
}
@Foo @Val(/*clazz = String.class*/) @Bla(value = RetentionPolicy.RUNTIME, clazz = String.class) class Bar {
Bar(int x) throws NullPointerException {
}
int[] foo()[] throws Exception, RuntimeException {
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment