javax.enterprise.inject.spi.Annotated.getAnnotations()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(107)

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

Annotated.getAnnotations介绍

[英]Get all annotations of the program element.
[中]获取程序元素的所有注释。

代码示例

代码示例来源:origin: org.jboss.weld.se/weld-se

/**
 * compares two annotated elements to see if they have the same annotations
 *
 * @param a1
 * @param a2
 * @return
 */
private static boolean compareAnnotated(Annotated a1, Annotated a2) {
  return a1.getAnnotations().equals(a2.getAnnotations());
}

代码示例来源:origin: apache/deltaspike

/**
 * Compares two annotated elements to see if they have the same annotations
 */
private static boolean compareAnnotated(Annotated a1, Annotated a2)
{
  return a1.getAnnotations().equals(a2.getAnnotations());
}

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

/**
 * compares two annotated elements to see if they have the same annotations
 *
 * @param a1
 * @param a2
 * @return
 */
private static boolean compareAnnotated(Annotated a1, Annotated a2) {
  return a1.getAnnotations().equals(a2.getAnnotations());
}

代码示例来源:origin: weld/core

/**
 *
 * @param annotated
 */
AnnotatedConfigurator(A annotated) {
  this.annotated = annotated;
  this.annotations = new HashSet<>(annotated.getAnnotations());
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

/**
 *
 * @param annotated
 */
AnnotatedConfigurator(A annotated) {
  this.annotated = annotated;
  this.annotations = new HashSet<>(annotated.getAnnotations());
}

代码示例来源:origin: weld/core

/**
 *
 * @param annotated
 */
AnnotatedConfigurator(A annotated) {
  this.annotated = annotated;
  this.annotations = new HashSet<>(annotated.getAnnotations());
}

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

/**
 *
 * @param annotated
 */
AnnotatedConfigurator(A annotated) {
  this.annotated = annotated;
  this.annotations = new HashSet<>(annotated.getAnnotations());
}

代码示例来源:origin: org.apache.camel/camel-test-cdi

@Override
public Set<Annotation> getAnnotations() {
  Set<Annotation> annotations = new HashSet<>(this.annotations);
  annotations.addAll(decorated.getAnnotations());
  return Collections.unmodifiableSet(annotations);
}

代码示例来源:origin: io.astefanutti.metrics.cdi/metrics-cdi

@Override
public Set<Annotation> getAnnotations() {
  Set<Annotation> annotations = new HashSet<>(this.annotations);
  annotations.addAll(decorated.getAnnotations());
  return Collections.unmodifiableSet(annotations);
}

代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl

public AnnotatedWrapper(Annotated delegate, boolean keepOriginalAnnotations, Annotation... annotations) {
  this.delegate = delegate;
  this.annotations = new HashSet<Annotation>(Arrays.asList(annotations));
  if (keepOriginalAnnotations) {
    this.annotations.addAll(delegate.getAnnotations());
  }
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

private boolean hasExcludeAnnotation(Annotated annotated, Pattern excludeAnnotation) {
  for (Annotation annotation : annotated.getAnnotations()) {
    if (excludeAnnotation.matcher(annotation.annotationType().getName()).matches()) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: com.kumuluz.ee.metrics/kumuluzee-metrics-core

@Override
public <T extends Annotation> Set<T> getAnnotations(Class<T> aClass) {
  Set<T> annotations = new HashSet<>(decorated.getAnnotations(aClass));
  T annotation = getDecoratingAnnotation(aClass);
  if (annotation != null) {
    annotations.add(annotation);
  }
  return Collections.unmodifiableSet(annotations);
}

代码示例来源:origin: org.jboss.seam.solder/seam-solder

@SuppressWarnings("unchecked")
public Set<Annotation> getQualifiers(BeanManager beanManager, GenericIdentifier identifier, Iterable<Annotation> annotations)
{
 return Beans.getQualifiers(beanManager, genericConfigurationPoints.get(identifier).getAnnotated().getAnnotations(), annotations);
}

代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl

private void validateStatelessSessionBean(Annotated type)
{
 assert type.getBaseType().equals(Sheep.class);
 assert rawTypeSetMatches(type.getTypeClosure(), Sheep.class, SheepLocal.class, Object.class);
 assert type.getAnnotations().size() == 2;
 assert annotationSetMatches(type.getAnnotations(), Tame.class, Stateless.class); // TODO
                                          // Check
}

代码示例来源:origin: org.infinispan/infinispan-cdi

protected void mergeAnnotationsOnElement(Annotated annotated, boolean overwriteExisting, AnnotationBuilder typeAnnotations) {
 for (Annotation annotation : annotated.getAnnotations()) {
   if (typeAnnotations.getAnnotation(annotation.annotationType()) != null) {
    if (overwriteExisting) {
      typeAnnotations.remove(annotation.annotationType());
      typeAnnotations.add(annotation);
    }
   } else {
    typeAnnotations.add(annotation);
   }
 }
}

代码示例来源:origin: io.silverware/cdi-microservice-provider

protected DefaultMethodHandler(final MicroserviceProxyBean proxyBean, final InjectionPoint injectionPoint) throws Exception {
 this.proxyBean = proxyBean;
 this.injectionPoint = injectionPoint;
 final Set<Annotation> qualifiers = proxyBean.getQualifiers().stream()
                       .filter(qualifier -> !matches(qualifier, MicroserviceReference.class))
                       .collect(Collectors.toSet());
 final MicroserviceMetaData metaData = VersionResolver.getInstance()
                            .createMicroserviceMetadataForInjectionPoint(proxyBean.getMicroserviceName(), proxyBean.getServiceInterface(), qualifiers, injectionPoint.getAnnotated().getAnnotations());
 this.lookupStrategy = LookupStrategyFactory.getStrategy(proxyBean.getContext(), metaData, injectionPoint.getAnnotated().getAnnotations());
}

代码示例来源:origin: weld/core

public static void validateAnnotated(Annotated annotated) {
  checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated);
  checkNotNull(annotated.getBaseType(), "getBaseType()", annotated);
  checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated);
}

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

public static void validateAnnotated(Annotated annotated) {
  checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated);
  checkNotNull(annotated.getBaseType(), "getBaseType()", annotated);
  checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated);
}

代码示例来源:origin: org.jboss.weld.se/weld-se

public static void validateAnnotated(Annotated annotated) {
  checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated);
  checkNotNull(annotated.getBaseType(), "getBaseType()", annotated);
  checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated);
}

代码示例来源:origin: weld/core

public static void validateAnnotated(Annotated annotated) {
  checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated);
  checkNotNull(annotated.getBaseType(), "getBaseType()", annotated);
  checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated);
}

相关文章