devdaily home | apple | java | perl | unix | directory | blog

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*****************************************************************************
 * Copyright (C) PicoContainer Organization. All rights reserved.            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *****************************************************************************/
package org.picocontainer;

/**
 * Interface realizing a visitor pattern for {@link PicoContainer} as described in the GoF.
 * The visitor should visit the container, its children, all registered {@link ComponentAdapter}
 * instances and all instantiated components.
 * 
 * @author Aslak Hellesøy
 * @author Jörg Schaible
 * @version $Revision: 3602 $
 */
public interface PicoVisitor {
    /**
     * Entry point for the PicoVisitor traversal. The given node is the first object, that is 
     * asked for acceptance. Only objects of type {@link PicoContainer}, {@link ComponentAdapter},
     * or {@link Parameter} are valid.
     * 
     * @param node the start node of the traversal.
     * @return a visitor-specific value.
     * @throws IllegalArgumentException in case of an argument of invalid type. 
     */
    Object traverse(Object node);

    /**
     * Visit a {@link PicoContainer} that has to accept the visitor.
     * 
     * @param pico the visited container.
     */

    void visitContainer(PicoContainer pico);
    /**
     * Visit a {@link ComponentAdapter} that has to accept the visitor.
     * 
     * @param componentAdapter the visited ComponentAdapter.
     */

    void visitComponentAdapter(ComponentAdapter componentAdapter);
    /**
     * Visit a {@link Parameter} that has to accept the visitor.
     * 
     * @param parameter the visited Parameter.
     */
    void visitParameter(Parameter parameter);
}




Copyright 1998-2008 Alvin Alexander
All Rights Reserved.
 
devdaily.com is based in louisville, kentucky, and this web site is hosted by godaddy.com