当前位置: 首页>>代码示例>>Java>>正文


Java AnnotatedConstructor类代码示例

本文整理汇总了Java中javax.enterprise.inject.spi.AnnotatedConstructor的典型用法代码示例。如果您正苦于以下问题:Java AnnotatedConstructor类的具体用法?Java AnnotatedConstructor怎么用?Java AnnotatedConstructor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AnnotatedConstructor类属于javax.enterprise.inject.spi包,在下文中一共展示了AnnotatedConstructor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hasAnnotation

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
static boolean hasAnnotation(AnnotatedType<?> type, Class<? extends Annotation> annotation) {
    if (type.isAnnotationPresent(annotation)) {
        return true;
    }
    for (AnnotatedMethod<?> method : type.getMethods()) {
        if (method.isAnnotationPresent(annotation)) {
            return true;
        }
    }
    for (AnnotatedConstructor<?> constructor : type.getConstructors()) {
        if (constructor.isAnnotationPresent(annotation)) {
            return true;
        }
    }
    for (AnnotatedField<?> field : type.getFields()) {
        if (field.isAnnotationPresent(annotation)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:22,代码来源:CdiSpiHelper.java

示例2: compare

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
public int compare(AnnotatedConstructor<? super T> arg0, AnnotatedConstructor<? super T> arg1)
{
    int result = callableComparator.compare(arg0, arg1);
    if (result != 0)
    {
        return result;
    }
    for (int i = 0; i < arg0.getJavaMember().getParameterTypes().length; ++i)
    {
        Class<?> p0 = arg0.getJavaMember().getParameterTypes()[i];
        Class<?> p1 = arg1.getJavaMember().getParameterTypes()[i];
        result = p0.getName().compareTo(p1.getName());
        if (result != 0)
        {
            return result;
        }
    }
    return 0;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:20,代码来源:Annotateds.java

示例3: modifyAnnotationsOnConstructorParameter

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Test
public void modifyAnnotationsOnConstructorParameter() throws NoSuchMethodException
{
    final AnnotatedTypeBuilder<Cat> builder = new AnnotatedTypeBuilder<Cat>();
    builder.readFromType(Cat.class, true);
    builder.removeFromConstructorParameter(Cat.class.getConstructor(String.class, String.class), 1, Default.class);
    builder.addToConstructorParameter(Cat.class.getConstructor(String.class, String.class), 1, new AnyLiteral());

    final AnnotatedType<Cat> catAnnotatedType = builder.create();
    Set<AnnotatedConstructor<Cat>> catCtors = catAnnotatedType.getConstructors();

    assertThat(catCtors.size(), is(2));

    for (AnnotatedConstructor<Cat> ctor : catCtors)
    {
        if (ctor.getParameters().size() == 2)
        {
            List<AnnotatedParameter<Cat>> ctorParams = ctor.getParameters();

            assertThat(ctorParams.get(1).getAnnotations().size(), is(1));
            assertThat((AnyLiteral) ctorParams.get(1).getAnnotations().toArray()[0], is(new AnyLiteral()));
        }
    }
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:25,代码来源:AnnotatedTypeBuilderTest.java

示例4: getConstructors

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<X>> getConstructors() {
    return delegate.getConstructors();
}
 
开发者ID:apache,项目名称:aries-jpa,代码行数:5,代码来源:ForwardingAnnotatedType.java

示例5: getConstructors

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<T>> getConstructors() {
    return wrapped.getConstructors();
}
 
开发者ID:mvc-spec,项目名称:ozark,代码行数:5,代码来源:AnnotatedTypeWrapper.java

示例6: getConstructors

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<X>> getConstructors()
{
    return original.getConstructors();
}
 
开发者ID:peter-mount,项目名称:opendata-common,代码行数:6,代码来源:MutableAnnotatedType.java

示例7: getConstructors

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<X>> getConstructors() {
    return decoratedType.getConstructors();
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:5,代码来源:AnnotatedTypeDecorator.java

示例8: getConstructors

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
public Set<AnnotatedConstructor<T>> getConstructors() {
    return delegate.getConstructors();
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:4,代码来源:HystrixExtension.java

示例9: getConstructors

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<T>> getConstructors() {
    return delegate.getConstructors();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:AnnotatedTypeDelegate.java

示例10: getConstructors

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<X>> getConstructors()
{
    // TODO Auto-generated method stub
    return null;
}
 
开发者ID:satago,项目名称:tapestry-jpa-transactions,代码行数:7,代码来源:NoopAnnotatedType.java

示例11: getConstructors

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<T>> getConstructors() {
	return type.getConstructors();
}
 
开发者ID:ocelotds,项目名称:ocelot,代码行数:5,代码来源:SpringConfigurationWrapper.java

示例12: AnnotatedPersistenceUnitProducerType

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
public AnnotatedPersistenceUnitProducerType(Set<Annotation> annotations) throws Exception {
	this.annotations = annotations;
	this.annotatedConstructors = new HashSet<AnnotatedConstructor<PersistenceUnitProducer>>(); 
	this.annotatedConstructors.add(new AnnotatedPersistenceUnitProducerConstructor());
}
 
开发者ID:spearal,项目名称:spearal-jpa2,代码行数:6,代码来源:SpearalExtension.java

示例13: getConstructors

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<PersistenceUnitProducer>> getConstructors() {
	return annotatedConstructors;
}
 
开发者ID:spearal,项目名称:spearal-jpa2,代码行数:5,代码来源:SpearalExtension.java

示例14: getConstructors

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<RequestScoped>> getConstructors() {
   return aType.getConstructors();
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:5,代码来源:PortletRequestScopedAnnotatedType.java

示例15: getConstructors

import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<SessionScoped>> getConstructors() {
   return aType.getConstructors();
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:5,代码来源:PortletSessionScopedAnnotatedType.java


注:本文中的javax.enterprise.inject.spi.AnnotatedConstructor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。