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

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

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

AnnotatedConstructor.getParameters介绍

暂无

代码示例

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

@Override
public List<AnnotatedParameter> getParameters() {
  final List<AnnotatedParameter> parameters = new ArrayList<>(ctor.getParameters().size());
  for (final AnnotatedParameter<?> ap : ctor.getParameters()) {
    parameters.add(new AnnotatedParameter() {

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

public AnnotatedConstructorWrapper(AnnotatedConstructor<X> delegate, AnnotatedTypeWrapper<X> declaringType, boolean keepOriginalAnnotations,
    Annotation... annotations) {
  super(delegate, declaringType, keepOriginalAnnotations, annotations);
  this.delegate = delegate;
  this.parameters =delegate.getParameters();
}

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

@Override
public Set<AnnotatedConstructor<Market>> getConstructors() {
  Set<AnnotatedConstructor<Market>> constructors = new HashSet<AnnotatedConstructor<Market>>();
  for (AnnotatedConstructor<Market> constructor : super.getConstructors()) {
    if (constructor.getParameters().size() == 1) {
      constructors.add(wrapConstructor(constructor, true, Any.Literal.INSTANCE));
    } else {
      constructors.add(constructor);
    }
  }
  return constructors;
}

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

public void checkDefaultConstructor()
{
  for (AnnotatedConstructor<T> constructor: annotatedType.getConstructors())
  {
    if (constructor.getParameters().isEmpty())
    {
      return;
    }
  }
  throw new WebBeansConfigurationException("@Interceptors interceptor must have no-arg constructor, but " + annotatedType.getJavaClass() + " has not");
}

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

public static boolean hasSimpleCdiConstructor(AnnotatedType<?> type) {
  for (AnnotatedConstructor<?> constructor : type.getConstructors()) {
    if (constructor.getParameters().isEmpty()) {
      return true;
    }
    if (constructor.isAnnotationPresent(Inject.class)) {
      return true;
    }
  }
  return false;
}

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

public static boolean hasSimpleCdiConstructor(AnnotatedType<?> type) {
  for (AnnotatedConstructor<?> constructor : type.getConstructors()) {
    if (constructor.getParameters().isEmpty()) {
      return true;
    }
    if (constructor.isAnnotationPresent(Inject.class)) {
      return true;
    }
  }
  return false;
}

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

public static boolean hasSimpleCdiConstructor(AnnotatedType<?> type) {
  for (AnnotatedConstructor<?> constructor : type.getConstructors()) {
    if (constructor.getParameters().isEmpty()) {
      return true;
    }
    if (constructor.isAnnotationPresent(Inject.class)) {
      return true;
    }
  }
  return false;
}

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

@Test
@SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "bba")
public void configuratorInitializedWithOriginalAT() {
  AnnotatedType<Cat> catAT = getCurrentManager().getExtension(ProcessAnnotatedTypeObserver.class).getOriginalCatAT();
  assertTrue(catAT.isAnnotationPresent(RequestScoped.class));
  AnnotatedConstructor<Cat> annotatedConstructor = catAT.getConstructors().stream()
      .filter(ac -> ac.getParameters().size() == 1 && ac.getParameters().get(0).getBaseType().equals(Feed.class)).findFirst().get();
  assertTrue(annotatedConstructor.getParameters().iterator().next().isAnnotationPresent(Cats.class));
  assertTrue(annotatedConstructor.isAnnotationPresent(Inject.class));
}

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

public static boolean hasSimpleCdiConstructor(AnnotatedType<?> type) {
  for (AnnotatedConstructor<?> constructor : type.getConstructors()) {
    if (constructor.getParameters().isEmpty()) {
      return true;
    }
    if (constructor.isAnnotationPresent(Inject.class)) {
      return true;
    }
  }
  return false;
}

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

public static boolean hasSimpleCdiConstructor(AnnotatedType<?> type) {
  for (AnnotatedConstructor<?> constructor : type.getConstructors()) {
    if (constructor.getParameters().isEmpty()) {
      return true;
    }
    if (constructor.isAnnotationPresent(Inject.class)) {
      return true;
    }
  }
  return false;
}

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

public <T> AnnotatedConstructor<T> decorate(AnnotatedConstructor<T> constructor)
{
 for (AnnotatedParameter<T> p : constructor.getParameters())
 {
   if (needsDecorating(p))
   {
    return new JmsDestinationConstructorWrapper<T>(constructor);
   }
 }
 return constructor;
}

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

private void validateFilterAnnotatedType(AnnotatedType<TestFilter> type) {
 assert type.getBaseType().equals(TestFilter.class);
 assert rawTypeSetMatches(type.getTypeClosure(), TestFilter.class, Filter.class, Object.class);
 assert type.getFields().size() == 4;
 assert type.getConstructors().size() == 1;
 assert type.getConstructors().iterator().next().getParameters().isEmpty();
 assert type.getMethods().size() == 4;
}

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

public static String formatAnnotatedConstructor(AnnotatedConstructor<?> constructor) {
  return Formats.formatSimpleClassName(constructor) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(constructor.getAnnotations()))
      + Formats.addSpaceIfNeeded(Formats.formatModifiers(constructor.getJavaMember().getModifiers())) + constructor.getDeclaringType().getJavaClass().getName()
      + Formats.formatAsFormalParameterList(constructor.getParameters());
}

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

public static String formatAnnotatedConstructor(AnnotatedConstructor<?> constructor) {
  return Formats.formatSimpleClassName(constructor) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(constructor.getAnnotations()))
      + Formats.addSpaceIfNeeded(Formats.formatModifiers(constructor.getJavaMember().getModifiers())) + constructor.getDeclaringType().getJavaClass().getName()
      + Formats.formatAsFormalParameterList(constructor.getParameters());
}

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

public static String formatAnnotatedConstructor(AnnotatedConstructor<?> constructor) {
  return Formats.formatSimpleClassName(constructor) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(constructor.getAnnotations()))
      + Formats.addSpaceIfNeeded(Formats.formatModifiers(constructor.getJavaMember().getModifiers())) + constructor.getDeclaringType().getJavaClass().getName()
      + Formats.formatAsFormalParameterList(constructor.getParameters());
}

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

public static String formatAnnotatedConstructor(AnnotatedConstructor<?> constructor) {
  return Formats.formatSimpleClassName(constructor) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(constructor.getAnnotations()))
      + Formats.addSpaceIfNeeded(Formats.formatModifiers(constructor.getJavaMember().getModifiers())) + constructor.getDeclaringType().getJavaClass().getName()
      + Formats.formatAsFormalParameterList(constructor.getParameters());
}

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

public static String formatAnnotatedConstructor(AnnotatedConstructor<?> constructor) {
  return Formats.formatSimpleClassName(constructor) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(constructor.getAnnotations()))
      + Formats.addSpaceIfNeeded(Formats.formatModifiers(constructor.getJavaMember().getModifiers())) + constructor.getDeclaringType().getJavaClass().getName()
      + Formats.formatAsFormalParameterList(constructor.getParameters());
}

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

public static String formatAnnotatedConstructor(AnnotatedConstructor<?> constructor) {
  return Formats.formatSimpleClassName(constructor) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(constructor.getAnnotations()))
      + Formats.addSpaceIfNeeded(Formats.formatModifiers(constructor.getJavaMember().getModifiers())) + constructor.getDeclaringType().getJavaClass().getName()
      + Formats.formatAsFormalParameterList(constructor.getParameters());
}

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

public <T> void collect(@Observes ProcessManagedBean<T> event) {
  for (AnnotatedField<?> field : event.getAnnotatedBeanClass().getFields()) {
    addAnnotatedTypeIfNecessary(field);
  }
  for (AnnotatedConstructor<?> constructor : event.getAnnotatedBeanClass().getConstructors()) {
    for (AnnotatedParameter<?> parameter : constructor.getParameters()) {
      addAnnotatedTypeIfNecessary(parameter);
    }
  }
}

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

public AnnotatedConstructorImpl(WebBeansContext webBeansContext, AnnotatedConstructor<X> annotatedConstructor, AnnotatedType<X> declaringType)
{
  super(webBeansContext, annotatedConstructor.getBaseType(), annotatedConstructor.getJavaMember(), declaringType);
  getAnnotations().addAll(annotatedConstructor.getAnnotations());
  for (AnnotatedParameter<X> annotatedParameter : annotatedConstructor.getParameters())
  {
    getParameters().add(new AnnotatedParameterImpl<>(webBeansContext, annotatedParameter.getBaseType(), this, annotatedParameter.getPosition()));
  }
}

相关文章