@Override protected Predicate getFilteringPredicate() { return predicate != null ? predicate : super.getFilteringPredicate(); }
@Override protected void doExecute(final InstallContext installContext) throws RepositoryException, TaskExecutionException { // get node where we should start visiting Session session = installContext.getJCRSession(workspace); Node node = session.getNode(absPath); // visitor to help decoupling matching from operating logic NodeVisitor visitor = new NodeVisitor() { @Override public void visit(Node node) throws RepositoryException { if (nodeMatches(node)) { operateOnNode(installContext, node); } } }; // predicate defining where we should stop visiting the hierarchy Predicate predicate = getFilteringPredicate(); NodeUtil.visit(node, visitor, predicate); }