private void processDocument(T model, Phase phase, String key, Document doc) {
            // Recursively invoke on the children
            if (aboveTable.contains(key)) {
                namedChildren(doc)
                    .forEach(e ->
                        // Tables and below has already been handled.
                        processDocument(model, phase, e.getKey(), e.getValue())
                    );

                // Process the document if in right phase and for right key (type of document)
                map
                    .getOrDefault(phase, emptyMap())
                    .getOrDefault(key, emptyList())
                    .forEach(c -> c.accept(model, doc));
            }

        }
This method is executed after the file has been created but before it is
returned to the code generator.

@param file the file to operate on
generator-parent/generator-translator/src/main/java/com/speedment/generator/translator/AbstractJavaClassTranslator.java