use of jakarta.enterprise.inject.spi.AnnotatedCallable in project hibernate-validator by hibernate.
the class ValidationExtension method determineConstrainedCallables.
private <T> Set<AnnotatedCallable<? super T>> determineConstrainedCallables(AnnotatedType<T> type) {
Set<AnnotatedCallable<? super T>> callables = new HashSet<>();
BeanDescriptor beanDescriptor = validator.getConstraintsForClass(type.getJavaClass());
determineConstrainedConstructors(type, beanDescriptor, callables);
determineConstrainedMethods(type, beanDescriptor, callables);
return callables;
}
use of jakarta.enterprise.inject.spi.AnnotatedCallable in project core by weld.
the class JsonObjectsTest method getFooAnnotatedMethod.
private static AnnotatedMethod<Foo> getFooAnnotatedMethod(String name) {
final Method method = findDeclaredFooMethod(name);
return new AnnotatedMethod<Foo>() {
@Override
public List<AnnotatedParameter<Foo>> getParameters() {
Type[] paramTypes = method.getGenericParameterTypes();
if (paramTypes.length == 0) {
return Collections.emptyList();
}
List<AnnotatedParameter<Foo>> params = new ArrayList<>();
for (int i = 0; i < paramTypes.length; i++) {
final Type baseType = paramTypes[i];
final Annotation[] annotations = method.getParameterAnnotations()[i];
params.add(new AnnotatedParameter<Foo>() {
@Override
public Type getBaseType() {
return baseType;
}
@Override
public Set<Type> getTypeClosure() {
throw new UnsupportedOperationException();
}
@Override
public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
throw new UnsupportedOperationException();
}
@Override
public Set<Annotation> getAnnotations() {
return new HashSet<>(Arrays.asList(annotations));
}
@Override
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
throw new UnsupportedOperationException();
}
@Override
public int getPosition() {
throw new UnsupportedOperationException();
}
@Override
public AnnotatedCallable<Foo> getDeclaringCallable() {
throw new UnsupportedOperationException();
}
});
}
return params;
}
@Override
public boolean isStatic() {
throw new UnsupportedOperationException();
}
@Override
public AnnotatedType<Foo> getDeclaringType() {
return new AnnotatedType<Foo>() {
@Override
public Type getBaseType() {
throw new UnsupportedOperationException();
}
@Override
public Set<Type> getTypeClosure() {
throw new UnsupportedOperationException();
}
@Override
public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
throw new UnsupportedOperationException();
}
@Override
public Set<Annotation> getAnnotations() {
throw new UnsupportedOperationException();
}
@Override
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
throw new UnsupportedOperationException();
}
@Override
public Class<Foo> getJavaClass() {
return Foo.class;
}
@Override
public Set<AnnotatedConstructor<Foo>> getConstructors() {
throw new UnsupportedOperationException();
}
@Override
public Set<AnnotatedMethod<? super Foo>> getMethods() {
throw new UnsupportedOperationException();
}
@Override
public Set<AnnotatedField<? super Foo>> getFields() {
throw new UnsupportedOperationException();
}
};
}
@Override
public Type getBaseType() {
throw new UnsupportedOperationException();
}
@Override
public Set<Type> getTypeClosure() {
throw new UnsupportedOperationException();
}
@Override
public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
throw new UnsupportedOperationException();
}
@Override
public Set<Annotation> getAnnotations() {
return new HashSet<>(Arrays.asList(method.getAnnotations()));
}
@Override
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
throw new UnsupportedOperationException();
}
@Override
public Method getJavaMember() {
return method;
}
};
}
Aggregations