org.jboss.errai.codegen.meta.MetaClass.getConstructors()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(91)

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

MetaClass.getConstructors介绍

暂无

代码示例

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

private List<MetaConstructor> getInjectableConstructors(final MetaClass type) {
 final Collection<Class<? extends Annotation>> injectAnnotations = injectionContext.getAnnotationsForElementType(WiringElementType.InjectionPoint);
 final List<MetaConstructor> cons = new ArrayList<>();
 for (final MetaConstructor con : type.getConstructors()) {
  for (final Class<? extends Annotation> anno : injectAnnotations) {
   if (con.isAnnotationPresent(anno)) {
    cons.add(con);
   }
  }
 }
 return cons;
}

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

private MetaConstructor getInjectableConstructor(final MetaClass type) {
 final Collection<Class<? extends Annotation>> injectAnnotations = injectionContext.getAnnotationsForElementType(WiringElementType.InjectionPoint);
 for (final MetaConstructor con : type.getConstructors()) {
  for (final Class<? extends Annotation> anno : injectAnnotations) {
   if (con.isAnnotationPresent(anno)) {
    return con;
   }
  }
 }
 return null;
}

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

for (final MetaConstructor ctor : enclosingType.getConstructors()) {
 if (ctor.isAnnotationPresent(annoType)) {
  annotated.add(ctor);
for (final MetaConstructor ctor : enclosingType.getConstructors()) {
 for (final MetaParameter param : ctor.getParameters()) {
  if (param.isAnnotationPresent(annoType)) {

代码示例来源:origin: org.jboss.errai/errai-data-binding

for (final MetaConstructor ctor : enclosingType.getConstructors()) {
 if (ctor.isAnnotationPresent(annoType)) {
  annotated.add(ctor);
for (final MetaConstructor ctor : enclosingType.getConstructors()) {
 for (final MetaParameter param : ctor.getParameters()) {
  if (param.isAnnotationPresent(annoType)) {

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

final MetaConstructor[] objMethods = Object_MetaClass.getConstructors();
final MetaConstructor[] nMethods = new MetaConstructor[constructors.length + objMethods.length];
System.arraycopy(constructors, 0, nMethods, 0, constructors.length);

代码示例来源:origin: org.jboss.errai/errai-codegen

final MetaConstructor[] objMethods = Object_MetaClass.getConstructors();
final MetaConstructor[] nMethods = new MetaConstructor[constructors.length + objMethods.length];
System.arraycopy(constructors, 0, nMethods, 0, constructors.length);

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

@Test
public void testGetConstructors() throws Exception {
 final MetaClass mc = getMetaClass(HasManyConstructors.class);
 final MetaConstructor[] ctors = mc.getConstructors();
 assertEquals("Expected only a single visible constructor to be returned.", 1, ctors.length);
}

相关文章