class MapInput implements Input<String> {

        private final Input<Map<String, Object>> sourceInput;
        private final String[] excludes;
        private static final Logger LOGGER = LogManager.getLogger(MapInput.class);
        private int lastSourceSize;

        private MapInput(Input<Map<String, Object>> sourceInput, String[] excludes) {
            this.sourceInput = sourceInput;
            this.excludes = excludes;
            this.lastSourceSize = PageCacheRecycler.BYTE_PAGE_SIZE;
        }

        @Override
        public String value() {<FILL_FUNCTION_BODY>}
    }

            Map<String, Object> value = sourceInput.value();
            if (value == null) {
                return null;
            }
            assert value instanceof LinkedHashMap<String, Object> : "the raw source order should be preserved";
            if (excludes != null) {
                for (String exclude : excludes) {
                    String[] path = exclude.split("\\.");
                    Maps.removeByPath(value, Arrays.asList(path));
                }
            }
            try (XContentBuilder xContentBuilder = new XContentBuilder(XContentType.JSON.xContent(), new BytesStreamOutput(lastSourceSize))) {
                BytesReference bytes = BytesReference.bytes(xContentBuilder.map(value));
                lastSourceSize = bytes.length();
                return bytes.utf8ToString();
            } catch (IOException ex) {
                LOGGER.error("could not parse xContent", ex);
            }
            return null;
        
<no_super_class>