01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings.util;
14:
15: import org.wings.SComponent;
16: import org.wings.SContainer;
17:
18: /**
19: * A visitor that is visits component hierarchies.
20: * The SComponent and SContainer implement the corresponding
21: * invite method.
22: *
23: * @author <a href="mailto:engels@mercatis.de">Holger Engels</a>
24: */
25: public interface ComponentVisitor {
26: /**
27: * Visit a SComponent.
28: *
29: * @param component the component to be visited
30: */
31: void visit(SComponent component) throws Exception;
32:
33: /**
34: * Visit a SContainer. A container contains multiple
35: * elements. If you are interested in these components,
36: * invite yourself
37: * ({@link SContainer#inviteEachComponent(ComponentVisitor)})
38: *
39: * @param container the component to be visited
40: */
41: void visit(SContainer container) throws Exception;
42: }
|