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

x33g5p2x  于2022-01-16 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(69)

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

AnnotatedConstructor.getAnnotation介绍

暂无

代码示例

代码示例来源:origin: jersey/jersey

@Override
public <T extends Annotation> T getAnnotation(final Class<T> annotationType) {
  return ctor.getAnnotation(annotationType);
}

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-impl

else if (c.getAnnotation(Inject.class) != null)

代码示例来源:origin: org.glassfish.jersey.ext.cdi/jersey-cdi1x

@Override
public <T extends Annotation> T getAnnotation(final Class<T> annotationType) {
  return ctor.getAnnotation(annotationType);
}

代码示例来源:origin: org.glassfish.jersey.containers.glassfish/jersey-gf-cdi

@Override
public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
  return ctor.getAnnotation(annotationType);
}

代码示例来源:origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
  return constructor.getAnnotation(annotationType);
}

代码示例来源:origin: org.apache.tomee.patch/bval-jsr

private <T> boolean computeIsConstructorValidated(Class<T> targetClass, Constructor<T> ctor) {
  final AnnotatedType<T> annotatedType =
    CDI.current().getBeanManager().createAnnotatedType(ctor.getDeclaringClass());
  final ValidateOnExecution annotation =
    annotatedType.getConstructors().stream().filter(ac -> ctor.equals(ac.getJavaMember())).findFirst()
      .map(ac -> ac.getAnnotation(ValidateOnExecution.class))
      .orElseGet(() -> ctor.getAnnotation(ValidateOnExecution.class));
  final Set<ExecutableType> validatedExecutableTypes =
    annotation == null ? classConfiguration : ExecutableTypes.interpret(annotation.type());
  return validatedExecutableTypes.contains(ExecutableType.CONSTRUCTORS);
}

代码示例来源:origin: org.apache.bval/bval-jsr

private <T> boolean computeIsConstructorValidated(Class<T> targetClass, Constructor<T> ctor) {
  final AnnotatedType<T> annotatedType =
    CDI.current().getBeanManager().createAnnotatedType(ctor.getDeclaringClass());
  final ValidateOnExecution annotation =
    annotatedType.getConstructors().stream().filter(ac -> ctor.equals(ac.getJavaMember())).findFirst()
      .map(ac -> ac.getAnnotation(ValidateOnExecution.class))
      .orElseGet(() -> ctor.getAnnotation(ValidateOnExecution.class));
  final Set<ExecutableType> validatedExecutableTypes =
    annotation == null ? classConfiguration : ExecutableTypes.interpret(annotation.type());
  return validatedExecutableTypes.contains(ExecutableType.CONSTRUCTORS);
}

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-impl

/**
 * Check that simple web beans class has compatible constructor.
 * @param annotatedType web beans annotatedType
 * @throws WebBeansConfigurationException if the web beans has incompatible
 *             constructor
 */
public boolean isConstructorOk(AnnotatedType<?> annotatedType) throws WebBeansConfigurationException
{
  Class<?> clazz = annotatedType.getJavaClass();
  Constructor<?> defaultCt = getNoArgConstructor(clazz);
  if (defaultCt != null )
  {
    return true;
  }
  Set<? extends AnnotatedConstructor<?>> constructors = annotatedType.getConstructors();
  for (AnnotatedConstructor<?> constructor : constructors)
  {
    if (constructor.getAnnotation(Inject.class) != null)
    {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: com.sun.jersey/jersey-servlet

boolean mustPatch = false;
if (constructor.getAnnotation(Inject.class) != null) {
  boolean methodHasEncodedAnnotation = constructor.isAnnotationPresent(Encoded.class);
  for (AnnotatedParameter<T> parameter : constructor.getParameters()) {

代码示例来源:origin: jersey/jersey-1.x

boolean mustPatch = false;
if (constructor.getAnnotation(Inject.class) != null) {
  boolean methodHasEncodedAnnotation = constructor.isAnnotationPresent(Encoded.class);
  for (AnnotatedParameter<T> parameter : constructor.getParameters()) {

代码示例来源:origin: com.sun.jersey/jersey-bundle

boolean mustPatch = false;
if (constructor.getAnnotation(Inject.class) != null) {
  boolean methodHasEncodedAnnotation = constructor.isAnnotationPresent(Encoded.class);
  for (AnnotatedParameter<T> parameter : constructor.getParameters()) {

相关文章