class Frame implements Function<V, Stream<String>> {

    private String fill(final Function<String, String> resolver) {

        final StringBuilder builder=new StringBuilder(model.length());
        final Matcher matcher=PlaceholderPattern.matcher(model);

        int index=0;

        while ( matcher.find() ) {

            final String modifier=matcher.group("modifier");
            final String name=matcher.group("name");

            final String value=resolver.apply(name);

            try {

                builder.append(model, index, matcher.start()).append(
                        "\\".equals(modifier) ? matcher.group().substring(1)
                                : "%".equals(modifier) ? URLEncoder.encode(value, UTF_8.name())
                                : value != null ? value
                                : ""
                );

            } catch ( final UnsupportedEncodingException unexpected ) {
                throw new UncheckedIOException(unexpected);
            }

            index=matcher.end();
        }

        builder.append(model.substring(index));

        return builder.toString();
    }

}