Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/htmlparser/visitors/NodeVisitor.java


1   // $Header: /home/cvs/jakarta-jmeter/src/htmlparser/org/htmlparser/visitors/NodeVisitor.java,v 1.2 2004/02/11 02:16:59 woolfel Exp $
2   /*
3    * ====================================================================
4    * Copyright 2002-2004 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   * 
18   */
19  
20  // The developers of JMeter and Apache are greatful to the developers
21  // of HTMLParser for giving Apache Software Foundation a non-exclusive
22  // license. The performance benefits of HTMLParser are clear and the
23  // users of JMeter will benefit from the hard work the HTMLParser
24  // team. For detailed information about HTMLParser, the project is
25  // hosted on sourceforge at http://htmlparser.sourceforge.net/.
26  //
27  // HTMLParser was originally created by Somik Raha in 2000. Since then
28  // a healthy community of users has formed and helped refine the
29  // design so that it is able to tackle the difficult task of parsing
30  // dirty HTML. Derrick Oswald is the current lead developer and was kind
31  // enough to assist JMeter.
32  
33  package org.htmlparser.visitors;
34  
35  import org.htmlparser.RemarkNode;
36  import org.htmlparser.StringNode;
37  import org.htmlparser.tags.EndTag;
38  import org.htmlparser.tags.ImageTag;
39  import org.htmlparser.tags.LinkTag;
40  import org.htmlparser.tags.Tag;
41  import org.htmlparser.tags.TitleTag;
42  
43  public abstract class NodeVisitor
44  {
45      private boolean recurseChildren;
46      private boolean recurseSelf;
47  
48      public NodeVisitor()
49      {
50          this(true);
51      }
52  
53      public NodeVisitor(boolean recurseChildren)
54      {
55          this.recurseChildren = recurseChildren;
56          this.recurseSelf = true;
57      }
58  
59      public NodeVisitor(boolean recurseChildren, boolean recurseSelf)
60      {
61          this.recurseChildren = recurseChildren;
62          this.recurseSelf = recurseSelf;
63      }
64  
65      public void visitTag(Tag tag)
66      {
67  
68      }
69  
70      public void visitStringNode(StringNode stringNode)
71      {
72      }
73  
74      public void visitLinkTag(LinkTag linkTag)
75      {
76      }
77  
78      public void visitImageTag(ImageTag imageTag)
79      {
80      }
81  
82      public void visitEndTag(EndTag endTag)
83      {
84  
85      }
86  
87      public void visitTitleTag(TitleTag titleTag)
88      {
89  
90      }
91      public void visitRemarkNode(RemarkNode remarkNode)
92      {
93  
94      }
95  
96      public boolean shouldRecurseChildren()
97      {
98          return recurseChildren;
99      }
100 
101     public boolean shouldRecurseSelf()
102     {
103         return recurseSelf;
104     }
105 
106     /**
107      * Override this method if you wish to do special
108      * processing upon completion of parsing 
109      */
110     public void finishedParsing()
111     {
112     }
113 }