private void addDescriptorsFromFields(MappingDescriptor mappingDescriptor, ClassDescriptor classDescriptor, Class clazz) { java.lang.reflect.Field[] fields = clazz.getDeclaredFields(); for (int index = 0; index < fields.length; index++) { Field fieldAnnotation = fields[index].getAnnotation(Field.class); if (fieldAnnotation != null) { addFieldDescriptor(classDescriptor, fields[index].getName(), fieldAnnotation); } // Check if there is an Bean annotation Bean beanAnnotation = fields[index].getAnnotation(Bean.class); if (beanAnnotation != null) { addBeanDescriptor(classDescriptor, fields[index].getName(), beanAnnotation); } // Check if there is an Collection annotation Collection collectionAnnotation = fields[index].getAnnotation(Collection.class); if (collectionAnnotation != null) { addCollectionDescriptor(mappingDescriptor, classDescriptor, fields[index], collectionAnnotation); } } }
private void addDescriptorsFromFields(MappingDescriptor mappingDescriptor, ClassDescriptor classDescriptor, Class clazz) { java.lang.reflect.Field[] fields = clazz.getDeclaredFields(); for (int index = 0; index < fields.length; index++) { Field fieldAnnotation = fields[index].getAnnotation(Field.class); if (fieldAnnotation != null) { addFieldDescriptor(classDescriptor, fields[index].getName(), fieldAnnotation); } // Check if there is an Bean annotation Bean beanAnnotation = fields[index].getAnnotation(Bean.class); if (beanAnnotation != null) { addBeanDescriptor(classDescriptor, fields[index].getName(), beanAnnotation); } // Check if there is an Collection annotation Collection collectionAnnotation = fields[index].getAnnotation(Collection.class); if (collectionAnnotation != null) { addCollectionDescriptor(mappingDescriptor, classDescriptor, fields[index], collectionAnnotation); } } }
if (collectionAnnotation != null) { addCollectionDescriptor(mappingDescriptor, classDescriptor, propertyDescriptor.getPropertyType().getDeclaredField(propertyDescriptor.getName()), collectionAnnotation);
if (collectionAnnotation != null) { addCollectionDescriptor(mappingDescriptor, classDescriptor, propertyDescriptor.getPropertyType().getDeclaredField(propertyDescriptor.getName()), collectionAnnotation);