private PropertyDescriptor readDescriptor(final PropertyReport report, final Class<?> type, final JavaMethod javaMethod, final PropertyMetaDataParser metaDataParser) { final String methodName = javaMethod.getName(); final Method method = getMethod(report, type, methodName); final PropertyDescriptor descriptor = metaDataParser.readDescriptor(method); return descriptor; }
/** * Reads the property descriptor information from the type. * * @param propertySetType the type to read the property descriptor. * @return the property descriptor provided by the methods of the type. * @throws NullPointerException if {@code propertySetType} is * <code>null</code>. * @throws IllegalArgumentException if {@code propertySetType} is not * annotated with {@link PropertySet}. */ public List<PropertyDescriptor> readDescriptors(final Class<?> propertySetType) throws NullPointerException, IllegalArgumentException { Arg.checkNotNull("propertySetType", propertySetType); PropertyUtils.checkPropertySetType(propertySetType); final Method[] methods = propertySetType.getMethods(); final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>(methods.length); for (final Method method : methods) { if (PropertyUtils.isPropertyMethod(method)) { final PropertyDescriptor descriptor = readDescriptor(method); descriptors.add(descriptor); } } return descriptors; }
private void addPropertyDescriptors(final Class<?> propertySetType, final List<DuplicatePropertyDeclarationException> exceptions) { final Method[] methods = propertySetType.getMethods(); final PropertiesContext context = configurationRegistry.get(propertySetType); if (context == null) { LOG.warn("No context found for property set '" + propertySetType.getName() + "'. Skipped."); return; } final PropertyMetaDataParser propertyMetaDataParser = PropertyMetaDataParser.create(context); for (final Method method : methods) { if (PropertyUtils.isPropertyMethod(method)) { final PropertyDescriptor descriptor = propertyMetaDataParser.readDescriptor(method); addDescriptor(propertySetType, descriptor, exceptions); } } }
return parser.readDescriptor(propertyMethod);