1 /* 2 * $Id: ComponentVisitor.java,v 1.3 2004/12/01 07:54:30 hengels Exp $ 3 * Copyright 2000,2005 wingS development team. 4 * 5 * This file is part of wingS (http://www.j-wings.org). 6 * 7 * wingS is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU Lesser General Public License 9 * as published by the Free Software Foundation; either version 2.1 10 * of the License, or (at your option) any later version. 11 * 12 * Please see COPYING for the complete licence. 13 */ 14 package org.wings.util; 15 16 import org.wings.SComponent; 17 import org.wings.SContainer; 18 19 /** 20 * A visitor that is visits component hierarchies. 21 * The SComponent and SContainer implement the corresponding 22 * invite method. 23 * 24 * @author <a HREF="mailto:engels@mercatis.de">Holger Engels</a> 25 * @version $Revision: 1.3 $ 26 */ 27 public interface ComponentVisitor { 28 /** 29 * Visit a SComponent. 30 * 31 * @param component the component to be visited 32 */ 33 void visit(SComponent component) throws Exception; 34 35 /** 36 * Visit a SContainer. A container contains multiple 37 * elements. If you are interested in these components, 38 * invite yourself 39 * ({@link SContainer#inviteEachComponent(ComponentVisitor)}) 40 * 41 * @param container the component to be visited 42 */ 43 void visit(SContainer container) throws Exception; 44 } 45 46 47