private <R> Optional<RowMapper<R>> createSpecializedRowMapper(StatementContext ctx,
                                                                  List<String> columnNames,
                                                                  List<ColumnNameMatcher> columnNameMatchers,
                                                                  List<String> unmatchedColumns,
                                                                  Function<T, R> postProcessor) {
        final List<PropertyData<T>> propList = new ArrayList<>();

        for (PojoProperty<T> property : getProperties(ctx.getConfig()).getProperties().values()) {
            Nested nested = property.getAnnotation(Nested.class).orElse(null);
            if (!JdbiAnnotations.isMapped(property)) {
                continue;
            }

            if (nested == null) {
                String paramName = addPropertyNamePrefix(prefix, getName(property));

                findColumnIndex(paramName, columnNames, columnNameMatchers, () -> debugName(property))
                    .ifPresent(index -> {
                        ColumnMapper<?> mapper = ctx.findColumnMapperFor(property.getQualifiedType().mapType(GenericTypes::box))
                            .orElseGet(() -> {
                                if (strictColumnTypeMapping) {
                                    throw new NoSuchMapperException(format(
                                        "Couldn't find mapper for property '%s' of type '%s' from %s", property.getName(), property.getQualifiedType(), type));
                                }
                                return ColumnMapper.getDefaultColumnMapper();
                            });

                        propList.add(new PropertyData<>(property, new SingleColumnMapper<>(mapper, index + 1)));
                        unmatchedColumns.remove(columnNames.get(index));
                    });
            } else {
                String nestedPrefix = addPropertyNamePrefix(prefix, nested.value());
                if (anyColumnsStartWithPrefix(columnNames, nestedPrefix, columnNameMatchers)) {

                    Optional<? extends RowMapper<?>> nestedMapper;
                    Type propertyType = property.getQualifiedType().getType();
                    if (propertyType instanceof ParameterizedType && ((ParameterizedType) propertyType).getRawType().equals(Optional.class)) {
                        Class<?> rawType = GenericTypes.findGenericParameter(propertyType, Optional.class)
                            .map(GenericTypes::getErasedType)
                            .orElseThrow(() -> new IllegalArgumentException(
                                format("Could not determine the type of Optional property %s", property.getName())));
                        nestedMapper = nestedMappers
                            .computeIfAbsent(property, d -> createNestedMapper(ctx, rawType, nestedPrefix))
                            .createSpecializedRowMapper(ctx, columnNames, columnNameMatchers, unmatchedColumns, Optional::ofNullable);
                    } else {
                        nestedMapper = nestedMappers
                            .computeIfAbsent(property, d -> createNestedMapper(ctx, GenericTypes.getErasedType(propertyType), nestedPrefix))
                            .createSpecializedRowMapper(ctx, columnNames, columnNameMatchers, unmatchedColumns, Function.identity());
                    }

                    nestedMapper
                        .ifPresent(mapper ->
                            propList.add(new PropertyData<>(property, mapper)));
                }
            }
        }

        if (propList.isEmpty() && !columnNames.isEmpty()) {
            return Optional.empty();
        }

        propList.sort(Comparator.comparing(p -> p.propagateNull ? 1 : 0));

        RowMapper<R> boundMapper = new BoundPojoMapper<>(propList, postProcessor);
        OptionalInt propagateNullColumnIndex = locatePropagateNullColumnIndex(columnNames, columnNameMatchers);

        if (propagateNullColumnIndex.isPresent()) {
            return Optional.of(new NullDelegatingMapper<>(propagateNullColumnIndex.getAsInt() + 1, boundMapper));
        } else {
            return Optional.of(boundMapper);
        }
    }
This class is the future home of BeanMapper functionality.
core/src/main/java/org/jdbi/v3/core/mapper/reflect/internal/PojoMapper.java