public PropertiesVisitor getVisitor()

in camel-upgrade-recipes/src/main/java/org/apache/camel/upgrade/customRecipes/ChangePropertyKeyWithCaseChange.java [66:90]


    public PropertiesVisitor<ExecutionContext> getVisitor() {
        return new PropertiesVisitor<>() {
            @Override
            public Properties visitEntry(Properties.Entry entry, ExecutionContext p) {
                for (String exclusion : exclusions) {
                    if (entry.getKey().equals(exclusion)) {
                        return super.visitEntry(entry, p);
                    }
                }

                if (entry.getKey().matches(oldPropertyKey)) {
                    entry = entry.withKey(getKey(entry))
                            .withPrefix(entry.getPrefix());
                }
                return super.visitEntry(entry, p);
            }

            //replace key
            private String getKey(Properties.Entry entry) {
                return newPrefix + entry.getKey().replaceFirst(oldPropertyKey, "$1").substring(0, 1).toLowerCase()
                       + entry.getKey().replaceFirst(oldPropertyKey, "$1").substring(1);

            }
        };
    }