com.google.inject.Key.ensureRetainedAtRuntime()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中com.google.inject.Key.ensureRetainedAtRuntime()方法的一些代码示例,展示了Key.ensureRetainedAtRuntime()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.ensureRetainedAtRuntime()方法的具体详情如下:
包路径:com.google.inject.Key
类名称:Key
方法名:ensureRetainedAtRuntime

Key.ensureRetainedAtRuntime介绍

暂无

代码示例

代码示例来源:origin: com.google.inject/guice

/** Gets the strategy for an annotation. */
static AnnotationStrategy strategyFor(Annotation annotation) {
 checkNotNull(annotation, "annotation");
 Class<? extends Annotation> annotationType = annotation.annotationType();
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 if (Annotations.isMarker(annotationType)) {
  return new AnnotationTypeStrategy(annotationType, annotation);
 }
 return new AnnotationInstanceStrategy(Annotations.canonicalizeIfNamed(annotation));
}

代码示例来源:origin: com.google.inject/guice

/** Gets the strategy for an annotation type. */
static AnnotationStrategy strategyFor(Class<? extends Annotation> annotationType) {
 annotationType = Annotations.canonicalizeIfNamed(annotationType);
 if (isAllDefaultMethods(annotationType)) {
  return strategyFor(generateAnnotation(annotationType));
 }
 checkNotNull(annotationType, "annotation type");
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 return new AnnotationTypeStrategy(annotationType, null);
}

代码示例来源:origin: com.google.code.guice/guice

/**
 * Gets the strategy for an annotation.
 */
static AnnotationStrategy strategyFor(Annotation annotation) {
 nonNull(annotation, "annotation");
 Class<? extends Annotation> annotationType = annotation.annotationType();
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 return new AnnotationInstanceStrategy(annotation);
}

代码示例来源:origin: com.google.code.guice/guice

/**
 * Gets the strategy for an annotation type.
 */
static AnnotationStrategy strategyFor(
  Class<? extends Annotation> annotationType) {
 nonNull(annotationType, "annotation type");
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 return new AnnotationTypeStrategy(annotationType, null);
}

代码示例来源:origin: org.sonatype.sisu/sisu-guice

/** Gets the strategy for an annotation. */
static AnnotationStrategy strategyFor(Annotation annotation) {
 checkNotNull(annotation, "annotation");
 Class<? extends Annotation> annotationType = annotation.annotationType();
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 if (Annotations.isMarker(annotationType)) {
  return new AnnotationTypeStrategy(annotationType, annotation);
 }
 return new AnnotationInstanceStrategy(Annotations.canonicalizeIfNamed(annotation));
}

代码示例来源:origin: com.jwebmp.inject/guice

/** Gets the strategy for an annotation. */
static AnnotationStrategy strategyFor(Annotation annotation) {
 checkNotNull(annotation, "annotation");
 Class<? extends Annotation> annotationType = annotation.annotationType();
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 if (Annotations.isMarker(annotationType)) {
  return new AnnotationTypeStrategy(annotationType, annotation);
 }
 return new AnnotationInstanceStrategy(Annotations.canonicalizeIfNamed(annotation));
}

代码示例来源:origin: org.xbib/guice

/**
 * Gets the strategy for an annotation.
 */
static AnnotationStrategy strategyFor(Annotation annotation) {
  checkNotNull(annotation, "annotation");
  Class<? extends Annotation> annotationType = annotation.annotationType();
  ensureRetainedAtRuntime(annotationType);
  ensureIsBindingAnnotation(annotationType);
  if (Annotations.isMarker(annotationType)) {
    return new AnnotationTypeStrategy(annotationType, annotation);
  }
  return new AnnotationInstanceStrategy(Annotations.canonicalizeIfNamed(annotation));
}

代码示例来源:origin: com.google/inject

/**
 * Gets the strategy for an annotation type.
 */
static AnnotationStrategy strategyFor(Class<? extends Annotation> annotationType) {
 checkNotNull(annotationType, "annotation type");
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 return new AnnotationTypeStrategy(Annotations.canonicalizeIfNamed(annotationType), null);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.inject

/**
 * Gets the strategy for an annotation type.
 */
static AnnotationStrategy strategyFor(Class<? extends Annotation> annotationType) {
 checkNotNull(annotationType, "annotation type");
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 return new AnnotationTypeStrategy(Annotations.canonicalizeIfNamed(annotationType), null);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Gets the strategy for an annotation type.
 */
static AnnotationStrategy strategyFor(Class<? extends Annotation> annotationType) {
 checkNotNull(annotationType, "annotation type");
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 return new AnnotationTypeStrategy(Annotations.canonicalizeIfNamed(annotationType), null);
}

代码示例来源:origin: org.sonatype.sisu/sisu-guice

/** Gets the strategy for an annotation type. */
static AnnotationStrategy strategyFor(Class<? extends Annotation> annotationType) {
 annotationType = Annotations.canonicalizeIfNamed(annotationType);
 if (isAllDefaultMethods(annotationType)) {
  return strategyFor(generateAnnotation(annotationType));
 }
 checkNotNull(annotationType, "annotation type");
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 return new AnnotationTypeStrategy(annotationType, null);
}

代码示例来源:origin: com.google/inject

/**
 * Gets the strategy for an annotation.
 */
static AnnotationStrategy strategyFor(Annotation annotation) {
 checkNotNull(annotation, "annotation");
 Class<? extends Annotation> annotationType = annotation.annotationType();
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 if (Annotations.isMarker(annotationType)) {
  return new AnnotationTypeStrategy(annotationType, annotation);
 }
 return new AnnotationInstanceStrategy(Annotations.canonicalizeIfNamed(annotation));
}

代码示例来源:origin: com.jwebmp.inject/guice

/** Gets the strategy for an annotation type. */
static AnnotationStrategy strategyFor(Class<? extends Annotation> annotationType) {
 annotationType = Annotations.canonicalizeIfNamed(annotationType);
 if (isAllDefaultMethods(annotationType)) {
  return strategyFor(generateAnnotation(annotationType));
 }
 checkNotNull(annotationType, "annotation type");
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 return new AnnotationTypeStrategy(annotationType, null);
}

代码示例来源:origin: org.xbib/guice

/**
 * Gets the strategy for an annotation type.
 */
static AnnotationStrategy strategyFor(Class<? extends Annotation> annotationType) {
  annotationType = Annotations.canonicalizeIfNamed(annotationType);
  if (isAllDefaultMethods(annotationType)) {
    return strategyFor(generateAnnotation(annotationType));
  }
  checkNotNull(annotationType, "annotation type");
  ensureRetainedAtRuntime(annotationType);
  ensureIsBindingAnnotation(annotationType);
  return new AnnotationTypeStrategy(annotationType, null);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.inject

/**
 * Gets the strategy for an annotation.
 */
static AnnotationStrategy strategyFor(Annotation annotation) {
 checkNotNull(annotation, "annotation");
 Class<? extends Annotation> annotationType = annotation.annotationType();
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 if (Annotations.isMarker(annotationType)) {
  return new AnnotationTypeStrategy(annotationType, annotation);
 }
 return new AnnotationInstanceStrategy(Annotations.canonicalizeIfNamed(annotation));
}

代码示例来源:origin: Nextdoor/bender

/**
 * Gets the strategy for an annotation.
 */
static AnnotationStrategy strategyFor(Annotation annotation) {
 checkNotNull(annotation, "annotation");
 Class<? extends Annotation> annotationType = annotation.annotationType();
 ensureRetainedAtRuntime(annotationType);
 ensureIsBindingAnnotation(annotationType);
 if (Annotations.isMarker(annotationType)) {
  return new AnnotationTypeStrategy(annotationType, annotation);
 }
 return new AnnotationInstanceStrategy(Annotations.canonicalizeIfNamed(annotation));
}

相关文章