public final class BusUtils { @Target({ElementType.METHOD}) @Retention(RetentionPolicy.CLASS) public @interface Subscribe { String name() default ""; } }
/** * Marker interface that designates extensible components * in Jenkins that can be implemented by plugins. * * <p> * See respective interfaces/classes for more about how to register custom * implementations to Jenkins. See {@link Extension} for how to have * Jenkins auto-discover your implementations. * * <p> * This interface is used for auto-generating * documentation. * * @author Kohsuke Kawaguchi * @see Plugin * @see Extension */ public interface ExtensionPoint { /** * Used by designers of extension points (direct subtypes of {@link ExtensionPoint}) to indicate that * the legacy instances are scoped to {@link Jenkins} instance. By default, legacy instances are * static scope. */ @Target(TYPE) @Retention(RUNTIME) @interface LegacyInstancesAreScopedToHudson {} }
/** * Outer class that exists solely to let us write {@code Partially.GwtIncompatible} instead of plain * {@code GwtIncompatible}. This is more accurate for {@link Futures#catching}, which is available * under GWT but with a slightly different signature. * * <p>We can't use {@code PartiallyGwtIncompatible} because then the GWT compiler wouldn't recognize * it as a {@code GwtIncompatible} annotation. And for {@code Futures.catching}, we need the GWT * compiler to autostrip the normal server method in order to expose the special, inherited GWT * version. */ @GwtCompatible final class Partially { /** * The presence of this annotation on an API indicates that the method <i>may</i> be used with the * <a href="http://www.gwtproject.org/">Google Web Toolkit</a> (GWT) but that it has <i>some * restrictions</i>. */ @Retention(RetentionPolicy.CLASS) @Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD}) @Documented @interface GwtIncompatible { String value(); } private Partially() {} }
public class InputSuppressWarningsHolder6 { public static void foo1(Object str) { String myString = (@SuppressWarnings("TypecastParenPad") String) str; } @Target(ElementType.TYPE_USE) @interface SuppressWarnings { String value(); } }
public class InputAnnotations4 { public static void methodName(@NotNull String args) { } @Target(ElementType.TYPE_USE) @interface NotNull { } }
public class InputAnnotations6 { abstract class UnmodifiableList<T> implements @Readonly List<@Readonly T> { } @Target(ElementType.TYPE_USE) @interface Readonly { } }
public class InputAnnotationUseStyleParams { @Target({}) public @interface myAnn { } }
class FetchProfile2 { //indent:16 exp:0 warn String name; //indent:4 exp:4 FetchOverride2[] fetchOverrides; //indent:4 exp:4 @Target({ ElementType.TYPE, ElementType.METHOD }) //indent:4 exp:4 @interface FetchOverride2 { //indent:4 exp:4 String association(); //indent:8 exp:8 } //indent:4 exp:4 } //indent:0 exp:0
public class InputAnnotations9 { public static <T> void methodName(Object str) { List<@Immutable ? extends Comparable<T>> unchangeable; } @Target(ElementType.TYPE_USE) @interface Immutable { } }
public static class TestCls { @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface A { int i(); float f(); } }
public class InputAnnotations5 { void monitorTemperature() throws @Critical Exception { } void monitorTemperature2() throws NullPointerException, @Critical Exception { } @Target(ElementType.TYPE_USE) @interface Critical { } }
public class InputAnnotations3 { public static void methodName(Object str) { String myString = (@NonNull String) str; } @Target(ElementType.TYPE_USE) @interface NonNull { } }
public class InputNoWhitespaceAfterArrayDeclarations3 { public void testWithAnnotationInMiddle1(final char @AnnotationAfterTest [] a) {}//Correct public void testWithAnnotationInMiddle2(final char@AnnotationAfterTest [] a) {}//Correct public void testWithAnnotationInMiddle3(final char @AnnotationAfterTest[] a) {}//Correct public void testWithAnnotationInMiddle4(final char@AnnotationAfterTest[]a) {}//Correct @Target(ElementType.TYPE_USE) @interface AnnotationAfterTest { } }
public class InputAnnotations7 { public static void main(String[] args) { Object object = new @Interned Object(); } @Target(ElementType.TYPE_USE) @interface Interned { } }
public static class TestCls { @Target({ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public static @interface A { int i() default 7; } void test1(@A int i) { } void test2(int i, @A int j) { } void test3(@A(i = 5) int i) { } }
@ThreadSafe public interface CostCalculator { /** * Calculates non-cumulative cost of a node. * * @param node The node to compute cost for. * @param stats The stats provider for node's stats and child nodes' stats, to be used if stats are needed to compute cost for the {@code node} */ PlanNodeCostEstimate calculateCost( PlanNode node, StatsProvider stats, Session session, TypeProvider types); @BindingAnnotation @Target(PARAMETER) @Retention(RUNTIME) @interface EstimatedExchanges {} }
public class InputAnnotations10 { public static Object methodName(Object str) { try { return null; } catch (@MyAnnotation1(name = "ABC", version = 1) Exception ex) { return ""; } } @Target(ElementType.TYPE_USE) @interface MyAnnotation1 { String name(); int version(); } }
@Target(ElementType.TYPE) private static @interface MetaConfig {
@Target(ElementType.TYPE) @interface ComposedContextConfiguration {