BeanMethodProvider beanMethodProvider = BeanMethodProvider.newInstance();
for (Class<?> type : types) {
Collection<AnnotatedMethod> typeMethodsOfType = beanMethodProvider.getMethods(type);
for (AnnotatedMethod typeMethod : typeMethodsOfType) {
if (!(typeMethod instanceof GetPropertyMethod)) {
throw new XOException("Only get methods are supported for projections: '" + typeMethod.getAnnotatedElement().getName() + "'.");
}
PropertyMethod propertyMethod = (PropertyMethod) typeMethod;
GetMethod proxyMethod = new GetMethod(propertyMethod.getName(), propertyMethod.getType());
addProxyMethod(proxyMethod, propertyMethod.getAnnotatedElement());
}