2
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
4
* This software is open source.
5
* See the bottom of this file for the licence.
12
* <code>Visitor</code> is used to implement the <code>Visitor</code>
13
* pattern in DOM4J. An object of this interface can be passed to a
14
* <code>Node</code> which will then call its typesafe methods. Please refer
15
* to the <i>Gang of Four </i> book of Design Patterns for more details on the
16
* <code>Visitor</code> pattern.
20
* This <a href="http://www.patterndepot.com/put/8/JavaPatterns.htm">site </a>
21
* has further discussion on design patterns and links to the GOF book. This <a
22
* href="http://www.patterndepot.com/put/8/visitor.pdf">link </a> describes the
23
* Visitor pattern in detail.
26
* @author <a href="mailto:james.strachan@metastuff.com">James Strachan </a>
27
* @version $Revision: 1.8 $
29
public interface Visitor {
32
* Visits the given <code>Document</code>
36
* is the <code>Document</code> node to visit.
38
void visit(Document document);
42
* Visits the given <code>DocumentType</code>
46
* is the <code>DocumentType</code> node to visit.
48
void visit(DocumentType documentType);
52
* Visits the given <code>Element</code>
56
* is the <code>Element</code> node to visit.
58
void visit(Element node);
62
* Visits the given <code>Attribute</code>
66
* is the <code>Attribute</code> node to visit.
68
void visit(Attribute node);
72
* Visits the given <code>CDATA</code>
76
* is the <code>CDATA</code> node to visit.
78
void visit(CDATA node);
82
* Visits the given <code>Comment</code>
86
* is the <code>Comment</code> node to visit.
88
void visit(Comment node);
92
* Visits the given <code>Entity</code>
96
* is the <code>Entity</code> node to visit.
98
void visit(Entity node);
102
* Visits the given <code>Namespace</code>
106
* is the <code>Namespace</code> node to visit.
108
void visit(Namespace namespace);
112
* Visits the given <code>ProcessingInstruction</code>
116
* is the <code>ProcessingInstruction</code> node to visit.
118
void visit(ProcessingInstruction node);
122
* Visits the given <code>Text</code>
126
* is the <code>Text</code> node to visit.
128
void visit(Text node);
132
* Redistribution and use of this software and associated documentation
133
* ("Software"), with or without modification, are permitted provided that the
134
* following conditions are met:
136
* 1. Redistributions of source code must retain copyright statements and
137
* notices. Redistributions must also contain a copy of this document.
139
* 2. Redistributions in binary form must reproduce the above copyright notice,
140
* this list of conditions and the following disclaimer in the documentation
141
* and/or other materials provided with the distribution.
143
* 3. The name "DOM4J" must not be used to endorse or promote products derived
144
* from this Software without prior written permission of MetaStuff, Ltd. For
145
* written permission, please contact dom4j-info@metastuff.com.
147
* 4. Products derived from this Software may not be called "DOM4J" nor may
148
* "DOM4J" appear in their names without prior written permission of MetaStuff,
149
* Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
151
* 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
153
* THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
154
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
155
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
156
* ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
157
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
158
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
159
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
160
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
161
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
162
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
163
* POSSIBILITY OF SUCH DAMAGE.
165
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.