All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.jcr.ItemVisitor Maven / Gradle / Ivy

There is a newer version: 2024.11.18598.20241113T125352Z-241000
Show newest version
/*
 * Copyright 2009 Day Management AG, Switzerland. All rights reserved.
 */
package javax.jcr;

/**
 * This interface defines two signatures of the visit method; one
 * taking a Node, the other a Property. When an object
 * implementing this interface is passed to {@link Item#accept(ItemVisitor
 * visitor)} the appropriate visit method is automatically
 * called, depending on whether the Item in question is a
 * Node or a Property. Different implementations of
 * this interface can be written for different purposes. It is, for example,
 * possible for the {@link #visit(Node node)} method to call
 * accept on the children of the passed node and thus recurse
 * through the tree performing some operation on each Item.
 */
public interface ItemVisitor {

    /**
     * This method is called when the ItemVisitor is passed to the
     * accept method of a Property. If this method
     * throws an exception the visiting process is aborted.
     *
     * @param property The Property that is accepting this
     *                 visitor.
     * @throws RepositoryException if an error occurs
     */
    public void visit(Property property) throws RepositoryException;

    /**
     * This method is called when the ItemVisitor is passed to the
     * accept method of a Node. If this method throws
     * an exception the visiting process is aborted.
     *
     * @param node The Node




© 2015 - 2024 Weber Informatics LLC | Privacy Policy