1 27 package org.htmlparser.visitors; 28 29 import org.htmlparser.Remark; 30 import org.htmlparser.Text; 31 import org.htmlparser.Tag; 32 33 68 public abstract class NodeVisitor 69 { 70 private boolean mRecurseChildren; 71 private boolean mRecurseSelf; 72 73 76 public NodeVisitor () 77 { 78 this (true); 79 } 80 81 87 public NodeVisitor (boolean recurseChildren) 88 { 89 this (recurseChildren, true); 90 } 91 92 101 public NodeVisitor (boolean recurseChildren, boolean recurseSelf) 102 { 103 mRecurseChildren = recurseChildren; 104 mRecurseSelf = recurseSelf; 105 } 106 107 111 public void beginParsing () 112 { 113 } 114 115 119 public void visitTag (Tag tag) 120 { 121 } 122 123 127 public void visitEndTag (Tag tag) 128 { 129 } 130 131 135 public void visitStringNode (Text string) 136 { 137 } 138 139 143 public void visitRemarkNode (Remark remark) 144 { 145 } 146 147 151 public void finishedParsing () 152 { 153 } 154 155 159 public boolean shouldRecurseChildren () 160 { 161 return (mRecurseChildren); 162 } 163 164 168 public boolean shouldRecurseSelf () 169 { 170 return (mRecurseSelf); 171 } 172 } 173 | Popular Tags |