public TreeVisitor getVisitor()

in camel-upgrade-recipes/src/main/java/org/apache/camel/upgrade/camel410/XmlDsl410Recipe.java [52:68]


    public TreeVisitor<?, ExecutionContext> getVisitor() {
        return new AbstractCamelXmlVisitor() {

            @Override
            public Xml.Tag doVisitTag(final Xml.Tag tag, final ExecutionContext ctx) {
                Xml.Tag t = super.doVisitTag(tag, ctx);

                //rename tags
                return transformations.entrySet().stream()
                        .filter(e -> e.getKey().matches(getCursor()))
                        //rename tag
                        .map(e -> t.withName(e.getValue()))
                        .findAny()
                        .orElse(t);
            }
        };
    }