本文整理汇总了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;
}
示例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;
}
示例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()));
}
}
}
示例4: getConstructors
import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<X>> getConstructors() {
return delegate.getConstructors();
}
示例5: getConstructors
import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<T>> getConstructors() {
return wrapped.getConstructors();
}
示例6: getConstructors
import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<X>> getConstructors()
{
return original.getConstructors();
}
示例7: getConstructors
import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<X>> getConstructors() {
return decoratedType.getConstructors();
}
示例8: getConstructors
import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
public Set<AnnotatedConstructor<T>> getConstructors() {
return delegate.getConstructors();
}
示例9: getConstructors
import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<T>> getConstructors() {
return delegate.getConstructors();
}
示例10: getConstructors
import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<X>> getConstructors()
{
// TODO Auto-generated method stub
return null;
}
示例11: getConstructors
import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<T>> getConstructors() {
return type.getConstructors();
}
示例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());
}
示例13: getConstructors
import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<PersistenceUnitProducer>> getConstructors() {
return annotatedConstructors;
}
示例14: getConstructors
import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<RequestScoped>> getConstructors() {
return aType.getConstructors();
}
示例15: getConstructors
import javax.enterprise.inject.spi.AnnotatedConstructor; //导入依赖的package包/类
@Override
public Set<AnnotatedConstructor<SessionScoped>> getConstructors() {
return aType.getConstructors();
}