本文整理了Java中java.lang.annotation.Retention.<init>
方法的一些代码示例,展示了Retention.<init>
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Retention.<init>
方法的具体详情如下:
包路径:java.lang.annotation.Retention
类名称:Retention
方法名:<init>
暂无
代码示例来源:origin: Blankj/AndroidUtilCode
public final class BusUtils {
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface Subscribe {
String name() default "";
}
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* Created by yhao on 2017/12/23.
* https://github.com/yhaolpz
*/
public class Screen {
public static final int width = 0;
public static final int height = 1;
@IntDef({width, height})
@Retention(RetentionPolicy.SOURCE)
@interface screenType {
}
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* Created by yhao on 2017/12/22.
* https://github.com/yhaolpz
*/
public class MoveType {
static final int fixed = 0;
public static final int free = 1;
public static final int active = 2;
public static final int slide = 3;
public static final int back = 4;
@IntDef({fixed, free, active, slide, back})
@Retention(RetentionPolicy.SOURCE)
@interface MOVE_TYPE {
}
}
代码示例来源:origin: jenkinsci/jenkins
/**
* 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 {}
}
代码示例来源:origin: google/guava
/**
* 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() {}
}
代码示例来源:origin: spring-projects/spring-framework
@Retention(RetentionPolicy.RUNTIME)
public static @interface MyAnnotation {
代码示例来源:origin: skylot/jadx
public static class TestCls {
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface A {
int i();
float f();
}
}
代码示例来源:origin: spring-projects/spring-framework
public class CustomAnnotations {
@Retention(RetentionPolicy.RUNTIME)
private @interface PrivateAnnotation {
String value();
}
@Retention(RetentionPolicy.RUNTIME)
@PrivateAnnotation("special")
public @interface SpecialAnnotation {
}
}
代码示例来源:origin: checkstyle/checkstyle
class InnerAnnotSingleLine2 { //indent:0 exp:0
@Retention(RetentionPolicy.SOURCE) @interface AnnotationOneLine {} //indent:5 exp:4 warn
} //indent:0 exp:0
@interface RepeatableInner4 { //indent:0 exp:0
代码示例来源:origin: spring-projects/spring-framework
@Component
class WithNestedAnnotation {
@Retention(RetentionPolicy.RUNTIME)
@Component
public static @interface MyComponent {
}
}
代码示例来源:origin: skylot/jadx
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) {
}
}
代码示例来源:origin: prestodb/presto
@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 {}
}
代码示例来源:origin: checkstyle/checkstyle
class InnerAnnotSingleLine { //indent:0 exp:0
@Retention(RetentionPolicy.SOURCE) @interface AnnotationOneLine {} //indent:3 exp:4 warn
} //indent:0 exp:0
代码示例来源:origin: spring-projects/spring-framework
@Retention(RetentionPolicy.RUNTIME)
public @interface TestConfiguration {
String value() default "";
代码示例来源:origin: spring-projects/spring-framework
@Retention(RetentionPolicy.RUNTIME)
@interface MyAsync { }
代码示例来源:origin: spring-projects/spring-framework
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
private static @interface MetaConfig {
代码示例来源:origin: spring-projects/spring-framework
@Retention(RetentionPolicy.RUNTIME)
@Import(SampleRegistrar.class)
public @interface Sample {
代码示例来源:origin: spring-projects/spring-framework
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@interface ComposedContextConfiguration {
代码示例来源:origin: spring-projects/spring-framework
@Retention(RUNTIME)
@Target(METHOD)
static @interface MetaSql {
@Retention(RUNTIME)
@Target(METHOD)
static @interface MetaSqlGroup {
代码示例来源:origin: spring-projects/spring-framework
@Retention(RUNTIME)
@interface ComposedSql {
内容来源于网络,如有侵权,请联系作者删除!