Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

switch to generics and version 1.5 compile

  • Loading branch information...
commit ec7de94fe5ac759bed9778ff944d564dfa420d1a 1 parent df8a59a
derrickoswald authored

Showing 139 changed files with 978 additions and 446 deletions. Show diff stats Hide diff stats

  1. +9 4 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/Filter.java
  2. +8 3 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/FilterBuilder.java
  3. +8 5 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/HtmlTreeCellRenderer.java
  4. +5 4 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/HtmlTreeModel.java
  5. +5 0 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/SubFilterList.java
  6. +5 0 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/layouts/NullLayoutManager.java
  7. +5 0 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/layouts/VerticalLayoutManager.java
  8. +5 0 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/AndFilterWrapper.java
  9. +12 7 ...ilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/HasAttributeFilterWrapper.java
  10. +5 0 ...erbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/HasChildFilterWrapper.java
  11. +5 0 ...rbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/HasParentFilterWrapper.java
  12. +5 0 ...builder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/HasSiblingFilterWrapper.java
  13. +8 3 ...rbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/NodeClassFilterWrapper.java
  14. +5 0 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/NotFilterWrapper.java
  15. +5 0 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/OrFilterWrapper.java
  16. +5 0 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/RegexFilterWrapper.java
  17. +5 0 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/StringFilterWrapper.java
  18. +9 4 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/TagNameFilterWrapper.java
  19. +5 0 lexer/src/main/java/org/htmlparser/Attribute.java
  20. +1 1  lexer/src/main/java/org/htmlparser/NodeFactory.java
  21. +2 3 lexer/src/main/java/org/htmlparser/Tag.java
  22. +32 32 lexer/src/main/java/org/htmlparser/http/ConnectionManager.java
  23. +5 0 lexer/src/main/java/org/htmlparser/http/Cookie.java
  24. +5 0 lexer/src/main/java/org/htmlparser/lexer/Cursor.java
  25. +5 0 lexer/src/main/java/org/htmlparser/lexer/InputStreamSource.java
  26. +20 14 lexer/src/main/java/org/htmlparser/lexer/Lexer.java
  27. +8 3 lexer/src/main/java/org/htmlparser/lexer/Page.java
  28. +5 0 lexer/src/main/java/org/htmlparser/lexer/PageAttribute.java
  29. +5 0 lexer/src/main/java/org/htmlparser/lexer/PageIndex.java
  30. +4 0 lexer/src/main/java/org/htmlparser/lexer/Source.java
  31. +5 0 lexer/src/main/java/org/htmlparser/lexer/StringSource.java
  32. +5 0 lexer/src/main/java/org/htmlparser/nodes/AbstractNode.java
  33. +4 0 lexer/src/main/java/org/htmlparser/nodes/RemarkNode.java
  34. +31 27 lexer/src/main/java/org/htmlparser/nodes/TagNode.java
  35. +4 0 lexer/src/main/java/org/htmlparser/nodes/TextNode.java
  36. +5 0 lexer/src/main/java/org/htmlparser/scanners/TagScanner.java
  37. +9 5 lexer/src/main/java/org/htmlparser/util/ChainedException.java
  38. +5 0 lexer/src/main/java/org/htmlparser/util/EncodingChangeException.java
  39. +5 5 lexer/src/main/java/org/htmlparser/util/NodeList.java
  40. +6 1 lexer/src/main/java/org/htmlparser/util/ParserException.java
  41. +7 7 lexer/src/main/java/org/htmlparser/util/sort/Sort.java
  42. +7 3 parser/src/main/java/org/htmlparser/Parser.java
  43. +14 9 parser/src/main/java/org/htmlparser/PrototypicalNodeFactory.java
  44. +9 4 parser/src/main/java/org/htmlparser/beans/BeanyBaby.java
  45. +5 0 parser/src/main/java/org/htmlparser/beans/FilterBean.java
  46. +4 0 parser/src/main/java/org/htmlparser/beans/HTMLLinkBean.java
  47. +4 0 parser/src/main/java/org/htmlparser/beans/HTMLTextBean.java
  48. +7 2 parser/src/main/java/org/htmlparser/beans/LinkBean.java
  49. +5 0 parser/src/main/java/org/htmlparser/beans/StringBean.java
  50. +4 0 parser/src/main/java/org/htmlparser/filters/AndFilter.java
  51. +26 4 parser/src/main/java/org/htmlparser/filters/CssSelectorNodeFilter.java
  52. +5 0 parser/src/main/java/org/htmlparser/filters/HasAttributeFilter.java
  53. +5 0 parser/src/main/java/org/htmlparser/filters/HasChildFilter.java
  54. +5 0 parser/src/main/java/org/htmlparser/filters/HasParentFilter.java
  55. +4 0 parser/src/main/java/org/htmlparser/filters/HasSiblingFilter.java
  56. +4 0 parser/src/main/java/org/htmlparser/filters/IsEqualFilter.java
  57. +4 0 parser/src/main/java/org/htmlparser/filters/LinkRegexFilter.java
  58. +5 0 parser/src/main/java/org/htmlparser/filters/LinkStringFilter.java
  59. +8 4 parser/src/main/java/org/htmlparser/filters/NodeClassFilter.java
  60. +4 0 parser/src/main/java/org/htmlparser/filters/NotFilter.java
  61. +4 0 parser/src/main/java/org/htmlparser/filters/OrFilter.java
  62. +5 0 parser/src/main/java/org/htmlparser/filters/RegexFilter.java
  63. +5 0 parser/src/main/java/org/htmlparser/filters/StringFilter.java
  64. +4 0 parser/src/main/java/org/htmlparser/filters/TagNameFilter.java
  65. +5 5 parser/src/main/java/org/htmlparser/http/HttpHeader.java
  66. +9 9 parser/src/main/java/org/htmlparser/sax/Attributes.java
  67. +8 5 parser/src/main/java/org/htmlparser/scanners/CompositeTagScanner.java
  68. +5 0 parser/src/main/java/org/htmlparser/scanners/JspScanner.java
  69. +6 8 parser/src/main/java/org/htmlparser/scanners/ScriptScanner.java
  70. +7 6 parser/src/main/java/org/htmlparser/scanners/StyleScanner.java
  71. +22 17 parser/src/main/java/org/htmlparser/tags/AppletTag.java
  72. +4 0 parser/src/main/java/org/htmlparser/tags/BaseHrefTag.java
  73. +5 0 parser/src/main/java/org/htmlparser/tags/BlockquoteTag.java
  74. +5 0 parser/src/main/java/org/htmlparser/tags/BodyTag.java
  75. +5 0 parser/src/main/java/org/htmlparser/tags/Bullet.java
  76. +5 0 parser/src/main/java/org/htmlparser/tags/BulletList.java
  77. +6 1 parser/src/main/java/org/htmlparser/tags/CompositeTag.java
  78. +5 0 parser/src/main/java/org/htmlparser/tags/DefinitionList.java
  79. +5 0 parser/src/main/java/org/htmlparser/tags/DefinitionListBullet.java
  80. +5 0 parser/src/main/java/org/htmlparser/tags/Div.java
  81. +4 0 parser/src/main/java/org/htmlparser/tags/DoctypeTag.java
  82. +5 0 parser/src/main/java/org/htmlparser/tags/FormTag.java
  83. +5 0 parser/src/main/java/org/htmlparser/tags/FrameSetTag.java
  84. +4 0 parser/src/main/java/org/htmlparser/tags/FrameTag.java
  85. +5 0 parser/src/main/java/org/htmlparser/tags/HeadTag.java
  86. +5 0 parser/src/main/java/org/htmlparser/tags/HeadingTag.java
  87. +4 0 parser/src/main/java/org/htmlparser/tags/Html.java
  88. +7 2 parser/src/main/java/org/htmlparser/tags/ImageTag.java
  89. +4 0 parser/src/main/java/org/htmlparser/tags/InputTag.java
  90. +4 0 parser/src/main/java/org/htmlparser/tags/JspTag.java
  91. +4 0 parser/src/main/java/org/htmlparser/tags/LabelTag.java
  92. +5 0 parser/src/main/java/org/htmlparser/tags/LinkTag.java
  93. +4 0 parser/src/main/java/org/htmlparser/tags/MetaTag.java
  94. +21 16 parser/src/main/java/org/htmlparser/tags/ObjectTag.java
  95. +5 0 parser/src/main/java/org/htmlparser/tags/OptionTag.java
  96. +5 0 parser/src/main/java/org/htmlparser/tags/ParagraphTag.java
  97. +4 0 parser/src/main/java/org/htmlparser/tags/ProcessingInstructionTag.java
  98. +5 0 parser/src/main/java/org/htmlparser/tags/ScriptTag.java
  99. +5 0 parser/src/main/java/org/htmlparser/tags/SelectTag.java
  100. +4 0 parser/src/main/java/org/htmlparser/tags/Span.java
  101. +5 0 parser/src/main/java/org/htmlparser/tags/StyleTag.java
  102. +5 0 parser/src/main/java/org/htmlparser/tags/TableColumn.java
  103. +5 0 parser/src/main/java/org/htmlparser/tags/TableHeader.java
  104. +5 0 parser/src/main/java/org/htmlparser/tags/TableRow.java
  105. +5 0 parser/src/main/java/org/htmlparser/tags/TableTag.java
  106. +5 0 parser/src/main/java/org/htmlparser/tags/TextareaTag.java
  107. +5 0 parser/src/main/java/org/htmlparser/tags/TitleTag.java
  108. +5 0 parser/src/main/java/org/htmlparser/util/CharacterReference.java
  109. +5 0 parser/src/main/java/org/htmlparser/util/DefaultParserFeedback.java
  110. +12 12 parser/src/main/java/org/htmlparser/util/ParserUtils.java
  111. +7 1 parser/src/main/java/org/htmlparser/util/Translate.java
  112. +3 3 parser/src/main/java/org/htmlparser/visitors/ObjectFindingVisitor.java
  113. +3 3 parser/src/test/java/org/htmlparser/tests/InstanceofPerformanceTest.java
  114. +1 3 parser/src/test/java/org/htmlparser/tests/ParserTest.java
  115. +17 17 parser/src/test/java/org/htmlparser/tests/ParserTestCase.java
  116. +66 66 parser/src/test/java/org/htmlparser/tests/lexerTests/AttributeTests.java
  117. +6 5 parser/src/test/java/org/htmlparser/tests/lexerTests/LexerTests.java
  118. +8 8 parser/src/test/java/org/htmlparser/tests/lexerTests/StreamTests.java
  119. +0 1  parser/src/test/java/org/htmlparser/tests/lexerTests/TagTests.java
  120. +20 2 parser/src/test/java/org/htmlparser/tests/scannersTests/CompositeTagScannerTest.java
  121. +0 2  parser/src/test/java/org/htmlparser/tests/scannersTests/ScriptScannerTest.java
  122. +15 15 parser/src/test/java/org/htmlparser/tests/tagTests/AppletTagTest.java
  123. +3 3 parser/src/test/java/org/htmlparser/tests/tagTests/BaseHrefTagTest.java
  124. +0 1  parser/src/test/java/org/htmlparser/tests/tagTests/BodyTagTest.java
  125. +0 4 parser/src/test/java/org/htmlparser/tests/tagTests/InputTagTest.java
  126. +0 2  parser/src/test/java/org/htmlparser/tests/tagTests/LabelTagTest.java
  127. +3 5 parser/src/test/java/org/htmlparser/tests/tagTests/TagTest.java
  128. +6 6 parser/src/test/java/org/htmlparser/tests/utilTests/BeanTest.java
  129. +6 1 parser/src/test/java/org/htmlparser/tests/utilTests/NodeListTest.java
  130. +17 9 parser/src/test/java/org/htmlparser/tests/utilTests/SortTest.java
  131. +2 2 parser/src/test/java/org/htmlparser/tests/visitorsTests/NodeVisitorTest.java
  132. +10 1 pom.xml
  133. +34 14 sitecapturer/src/main/java/org/htmlparser/parserapplications/SiteCapturer.java
  134. +5 4 thumbelina/src/main/java/org/htmlparser/lexerapplications/thumbelina/Picture.java
  135. +8 5 thumbelina/src/main/java/org/htmlparser/lexerapplications/thumbelina/PicturePanel.java
  136. +3 11 thumbelina/src/main/java/org/htmlparser/lexerapplications/thumbelina/Sequencer.java
  137. +8 15 thumbelina/src/main/java/org/htmlparser/lexerapplications/thumbelina/Thumbelina.java
  138. +5 0 thumbelina/src/main/java/org/htmlparser/lexerapplications/thumbelina/ThumbelinaFrame.java
  139. +5 2 thumbelina/src/main/java/org/htmlparser/lexerapplications/thumbelina/TileSet.java
13 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/Filter.java
@@ -52,6 +52,11 @@
52 52 NodeFilter
53 53 {
54 54 /**
  55 + *
  56 + */
  57 + private static final long serialVersionUID = 1L;
  58 +
  59 + /**
55 60 * Create a new filter from the class name.
56 61 * @param class_name The class to instatiate.
57 62 * @return The constructed filter object.
@@ -63,7 +68,7 @@ public static Filter instantiate (String class_name)
63 68 ret = null;
64 69 try
65 70 {
66   - Class cls = Class.forName (class_name);
  71 + Class<?> cls = Class.forName (class_name);
67 72 ret = (Filter)cls.newInstance ();
68 73 mWrappers.put (ret.getNodeFilter ().getClass ().getName (), class_name);
69 74 }
@@ -91,7 +96,7 @@ public static Filter instantiate (String class_name)
91 96 * Map from cilter class to wrapper.
92 97 * Populated as part of each wrapper being loaded.
93 98 */
94   - protected static Hashtable mWrappers = new Hashtable ();
  99 + protected static Hashtable<String,String> mWrappers = new Hashtable<String,String> ();
95 100
96 101 /**
97 102 * Line separator string.
@@ -342,13 +347,13 @@ public static String deconstitute (Filter[] filters) throws IOException
342 347 public static Filter[] reconstitute (String string, Parser context)
343 348 {
344 349 Filter[] ret;
345   - Vector vector;
  350 + Vector<Filter> vector;
346 351 int index;
347 352 String code;
348 353 Object object;
349 354 Filter filter;
350 355
351   - vector = new Vector ();
  356 + vector = new Vector<Filter> ();
352 357 try
353 358 {
354 359 while (string.startsWith ("["))
11 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/FilterBuilder.java
@@ -136,7 +136,12 @@
136 136 DropTargetListener,
137 137 ClipboardOwner
138 138 {
139   - static final String TITLE = "HTML Parser FilterBuilder";
  139 + /**
  140 + *
  141 + */
  142 + private static final long serialVersionUID = 1L;
  143 +
  144 + static final String TITLE = "HTML Parser FilterBuilder";
140 145
141 146 static final URL mDocumentBase;
142 147
@@ -197,7 +202,7 @@
197 202 /**
198 203 * Selected commands.
199 204 */
200   - protected Vector mSelection;
  205 + protected Vector<Filter> mSelection;
201 206
202 207 /**
203 208 * If true selection moved.
@@ -430,7 +435,7 @@ public FilterBuilder ()
430 435 addMouseMotionListener (this);
431 436
432 437 // clipboard buffer
433   - mSelection = new Vector ();
  438 + mSelection = new Vector<Filter> ();
434 439 }
435 440
436 441 /**
13 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/HtmlTreeCellRenderer.java
@@ -34,10 +34,8 @@
34 34
35 35 import org.htmlparser.Attribute;
36 36 import org.htmlparser.Node;
37   -import org.htmlparser.lexer.Cursor;
38 37 import org.htmlparser.nodes.TagNode;
39 38 import org.htmlparser.nodes.TextNode;
40   -import org.htmlparser.util.ParserException;
41 39 import org.htmlparser.util.Translate;
42 40
43 41 /**
@@ -50,6 +48,11 @@
50 48 TreeCellRenderer
51 49 {
52 50 /**
  51 + *
  52 + */
  53 + private static final long serialVersionUID = 1L;
  54 +
  55 + /**
53 56 * Create a new tree cell renderer for Nodes.
54 57 */
55 58 public HtmlTreeCellRenderer ()
@@ -72,7 +75,7 @@ public String toHtml (TagNode tag)
72 75 {
73 76 int length;
74 77 int size;
75   - Vector attributes;
  78 + Vector<Attribute> attributes;
76 79 Attribute attribute;
77 80 String s;
78 81 boolean children;
@@ -83,14 +86,14 @@ public String toHtml (TagNode tag)
83 86 size = attributes.size ();
84 87 for (int i = 0; i < size; i++)
85 88 {
86   - attribute = (Attribute)attributes.elementAt (i);
  89 + attribute = attributes.elementAt (i);
87 90 length += attribute.getLength ();
88 91 }
89 92 ret = new StringBuffer (length);
90 93 ret.append ("<");
91 94 for (int i = 0; i < size; i++)
92 95 {
93   - attribute = (Attribute)attributes.elementAt (i);
  96 + attribute = attributes.elementAt (i);
94 97 attribute.toString (ret);
95 98 }
96 99 ret.append (">");
9 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/HtmlTreeModel.java
@@ -42,7 +42,7 @@
42 42 /**
43 43 * The list of tree listeners.
44 44 */
45   - protected Vector mTreeListeners;
  45 + protected Vector<TreeModelListener> mTreeListeners;
46 46
47 47 /**
48 48 * The root {@link Node}.
@@ -59,7 +59,7 @@
59 59 */
60 60 public HtmlTreeModel (NodeList root)
61 61 {
62   - mTreeListeners = new Vector ();
  62 + mTreeListeners = new Vector<TreeModelListener> ();
63 63 // for simplicity we encapsulate the nodelist in a Html tag
64 64 mRoot = new Html ();
65 65 mRoot.setChildren (root);
@@ -207,15 +207,16 @@ public boolean isLeaf (Object node)
207 207 * @param path {@inheritDoc}
208 208 * @param newValue {@inheritDoc}
209 209 */
  210 + @SuppressWarnings("unchecked")
210 211 public void valueForPathChanged (TreePath path, Object newValue)
211 212 {
212 213 TreeModelEvent event;
213   - Vector v;
  214 + Vector<TreeModelListener> v;
214 215
215 216 event = new TreeModelEvent (this, path);
216 217 synchronized (mTreeListeners)
217 218 {
218   - v = (Vector)mTreeListeners.clone ();
  219 + v = (Vector<TreeModelListener>)(mTreeListeners.clone ());
219 220 }
220 221
221 222 for (int i = 0; i < v.size (); i++)
5 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/SubFilterList.java
@@ -41,6 +41,11 @@
41 41 JPanel
42 42 {
43 43 /**
  44 + *
  45 + */
  46 + private static final long serialVersionUID = 1L;
  47 +
  48 + /**
44 49 * Padding for the drop target.
45 50 */
46 51 protected int mExtra = 25; // for now
5 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/layouts/NullLayoutManager.java
@@ -39,6 +39,11 @@
39 39 Serializable
40 40 {
41 41 /**
  42 + *
  43 + */
  44 + private static final long serialVersionUID = 1L;
  45 +
  46 + /**
42 47 * Constructs a NullLayoutManager object.
43 48 */
44 49 public NullLayoutManager ()
5 ...builder/src/main/java/org/htmlparser/parserapplications/filterbuilder/layouts/VerticalLayoutManager.java
@@ -40,6 +40,11 @@
40 40 Serializable
41 41 {
42 42 /**
  43 + *
  44 + */
  45 + private static final long serialVersionUID = 1L;
  46 +
  47 + /**
43 48 * Constructs a VerticalLayoutManager object.
44 49 */
45 50 public VerticalLayoutManager ()
5 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/AndFilterWrapper.java
@@ -40,6 +40,11 @@
40 40 Filter
41 41 {
42 42 /**
  43 + *
  44 + */
  45 + private static final long serialVersionUID = 1L;
  46 +
  47 + /**
43 48 * The drop target container.
44 49 */
45 50 protected SubFilterList mContainer;
19 ...er/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/HasAttributeFilterWrapper.java
@@ -64,6 +64,11 @@
64 64 DocumentListener
65 65 {
66 66 /**
  67 + *
  68 + */
  69 + private static final long serialVersionUID = 1L;
  70 +
  71 + /**
67 72 * The underlying filter.
68 73 */
69 74 protected HasAttributeFilter mFilter;
@@ -126,9 +131,9 @@ public HasAttributeFilterWrapper ()
126 131 * @param set The set to add to.
127 132 * @param node The node with attributes to add.
128 133 */
129   - protected void addAttributes (Set set, Node node)
  134 + protected void addAttributes (Set<String> set, Node node)
130 135 {
131   - Vector attributes;
  136 + Vector<Attribute> attributes;
132 137 Attribute attribute;
133 138 String name;
134 139 NodeList children;
@@ -158,9 +163,9 @@ protected void addAttributes (Set set, Node node)
158 163 * @param set The set to add to.
159 164 * @param node The node with attributes to add.
160 165 */
161   - protected void addAttributeValues (Set set, Node node)
  166 + protected void addAttributeValues (Set<String> set, Node node)
162 167 {
163   - Vector attributes;
  168 + Vector<Attribute> attributes;
164 169 Attribute attribute;
165 170 String value;
166 171 NodeList children;
@@ -235,12 +240,12 @@ public NodeFilter getNodeFilter ()
235 240 */
236 241 public void setNodeFilter (NodeFilter filter, Parser context)
237 242 {
238   - Set set;
  243 + Set<String> set;
239 244 String name;
240 245 String value;
241 246
242 247 mFilter = (HasAttributeFilter)filter;
243   - set = new HashSet ();
  248 + set = new HashSet<String> ();
244 249 context.reset ();
245 250 try
246 251 {
@@ -251,7 +256,7 @@ public void setNodeFilter (NodeFilter filter, Parser context)
251 256 {
252 257 // oh well, we tried
253 258 }
254   - for (Iterator iterator = set.iterator (); iterator.hasNext (); )
  259 + for (Iterator<String> iterator = set.iterator (); iterator.hasNext (); )
255 260 mAttributeName.addItem (iterator.next ());
256 261 name = mFilter.getAttributeName ();
257 262 if (!name.equals (""))
5 ...uilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/HasChildFilterWrapper.java
@@ -47,6 +47,11 @@
47 47 ActionListener
48 48 {
49 49 /**
  50 + *
  51 + */
  52 + private static final long serialVersionUID = 1L;
  53 +
  54 + /**
50 55 * The underlying filter.
51 56 */
52 57 protected HasChildFilter mFilter;
5 ...ilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/HasParentFilterWrapper.java
@@ -47,6 +47,11 @@
47 47 ActionListener
48 48 {
49 49 /**
  50 + *
  51 + */
  52 + private static final long serialVersionUID = 1L;
  53 +
  54 + /**
50 55 * The underlying filter.
51 56 */
52 57 protected HasParentFilter mFilter;
5 ...lder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/HasSiblingFilterWrapper.java
@@ -45,6 +45,11 @@
45 45 ActionListener
46 46 {
47 47 /**
  48 + *
  49 + */
  50 + private static final long serialVersionUID = 1L;
  51 +
  52 + /**
48 53 * The underlying filter.
49 54 */
50 55 protected HasSiblingFilter mFilter;
11 ...ilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/NodeClassFilterWrapper.java
@@ -57,6 +57,11 @@
57 57 // DocumentListener
58 58 {
59 59 /**
  60 + *
  61 + */
  62 + private static final long serialVersionUID = 1L;
  63 +
  64 + /**
60 65 * The underlying filter.
61 66 */
62 67 protected NodeClassFilter mFilter;
@@ -128,7 +133,7 @@ public void setNodeFilter (NodeFilter filter, Parser context)
128 133 {
129 134 NodeFactory factory;
130 135 PrototypicalNodeFactory proto;
131   - Set names;
  136 + Set<String> names;
132 137 String name;
133 138 Tag tag;
134 139
@@ -140,9 +145,9 @@ public void setNodeFilter (NodeFilter filter, Parser context)
140 145 proto = (PrototypicalNodeFactory)factory;
141 146 // iterate over the classes
142 147 names = proto.getTagNames ();
143   - for (Iterator iterator = names.iterator (); iterator.hasNext (); )
  148 + for (Iterator<String> iterator = names.iterator (); iterator.hasNext (); )
144 149 {
145   - name = (String)iterator.next ();
  150 + name = iterator.next ();
146 151 tag = proto.get (name);
147 152 mClass.addItem (tag.getClass ().getName ());
148 153 }
5 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/NotFilterWrapper.java
@@ -40,6 +40,11 @@
40 40 Filter
41 41 {
42 42 /**
  43 + *
  44 + */
  45 + private static final long serialVersionUID = 1L;
  46 +
  47 + /**
43 48 * The drop target container.
44 49 */
45 50 protected SubFilterList mContainer;
5 filterbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/OrFilterWrapper.java
@@ -40,6 +40,11 @@
40 40 Filter
41 41 {
42 42 /**
  43 + *
  44 + */
  45 + private static final long serialVersionUID = 1L;
  46 +
  47 + /**
43 48 * The drop target container.
44 49 */
45 50 protected SubFilterList mContainer;
5 ...erbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/RegexFilterWrapper.java
@@ -53,6 +53,11 @@
53 53 DocumentListener
54 54 {
55 55 /**
  56 + *
  57 + */
  58 + private static final long serialVersionUID = 1L;
  59 +
  60 + /**
56 61 * Mapping for RegexFilter constants to strings.
57 62 */
58 63 public static Object[][] mMap;
5 ...rbuilder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/StringFilterWrapper.java
@@ -56,6 +56,11 @@
56 56 Runnable
57 57 {
58 58 /**
  59 + *
  60 + */
  61 + private static final long serialVersionUID = 1L;
  62 +
  63 + /**
59 64 * The underlying filter.
60 65 */
61 66 protected StringFilter mFilter;
13 ...builder/src/main/java/org/htmlparser/parserapplications/filterbuilder/wrappers/TagNameFilterWrapper.java
@@ -54,6 +54,11 @@
54 54 ActionListener
55 55 {
56 56 /**
  57 + *
  58 + */
  59 + private static final long serialVersionUID = 1L;
  60 +
  61 + /**
57 62 * The underlying filter.
58 63 */
59 64 protected TagNameFilter mFilter;
@@ -124,10 +129,10 @@ public NodeFilter getNodeFilter ()
124 129 */
125 130 public void setNodeFilter (NodeFilter filter, Parser context)
126 131 {
127   - Set set;
  132 + Set<String> set;
128 133
129 134 mFilter = (TagNameFilter)filter;
130   - set = new HashSet ();
  135 + set = new HashSet<String> ();
131 136 context.reset ();
132 137 try
133 138 {
@@ -138,7 +143,7 @@ public void setNodeFilter (NodeFilter filter, Parser context)
138 143 {
139 144 // oh well, we tried
140 145 }
141   - for (Iterator iterator = set.iterator (); iterator.hasNext (); )
  146 + for (Iterator<String> iterator = set.iterator (); iterator.hasNext (); )
142 147 mName.addItem (iterator.next ());
143 148 mName.setSelectedItem (mFilter.getName ());
144 149 }
@@ -196,7 +201,7 @@ public String toJavaCode (StringBuffer out, int[] context)
196 201 * @param set The set to add to.
197 202 * @param node The node to get the names from.
198 203 */
199   - protected void addName (Set set, Node node)
  204 + protected void addName (Set<String> set, Node node)
200 205 {
201 206 NodeList children;
202 207
5 lexer/src/main/java/org/htmlparser/Attribute.java
@@ -212,6 +212,11 @@
212 212 Serializable
213 213 {
214 214 /**
  215 + *
  216 + */
  217 + private static final long serialVersionUID = 1L;
  218 +
  219 + /**
215 220 * The name of this attribute.
216 221 * The part before the equals sign, or the stand-alone attribute.
217 222 * This will be <code>null</code> if the attribute is whitespace.
2  lexer/src/main/java/org/htmlparser/NodeFactory.java
@@ -87,7 +87,7 @@ Remark createRemarkNode (Page page, int start, int end)
87 87 * when creating the node.
88 88 * @return A tag node comprising the indicated characters from the page.
89 89 */
90   - Tag createTagNode (Page page, int start, int end, Vector attributes)
  90 + Tag createTagNode (Page page, int start, int end, Vector<Attribute> attributes)
91 91 throws
92 92 ParserException;
93 93 }
5 lexer/src/main/java/org/htmlparser/Tag.java
@@ -25,7 +25,6 @@
25 25
26 26 package org.htmlparser;
27 27
28   -import java.util.Hashtable;
29 28 import java.util.Vector;
30 29
31 30 import org.htmlparser.scanners.Scanner;
@@ -94,7 +93,7 @@
94 93 * @return Returns the list of {@link Attribute Attributes} in the tag.
95 94 * @see #setAttributesEx
96 95 */
97   - Vector getAttributesEx ();
  96 + Vector<Attribute> getAttributesEx ();
98 97
99 98 /**
100 99 * Sets the attributes.
@@ -104,7 +103,7 @@
104 103 * @param attribs The attribute collection to set.
105 104 * @see #getAttributesEx
106 105 */
107   - void setAttributesEx (Vector attribs);
  106 + void setAttributesEx (Vector<Attribute> attribs);
108 107
109 108 /**
110 109 * Return the name of this tag.
64 lexer/src/main/java/org/htmlparser/http/ConnectionManager.java
@@ -53,7 +53,7 @@
53 53 * Default Request header fields.
54 54 * So far this is just "User-Agent" and "Accept-Encoding".
55 55 */
56   - protected static Hashtable mDefaultRequestProperties = new Hashtable ();
  56 + protected static Hashtable<String,String> mDefaultRequestProperties = new Hashtable<String,String> ();
57 57 static
58 58 {
59 59 mDefaultRequestProperties.put ("User-Agent", "HTMLParser/"
@@ -106,7 +106,7 @@
106 106 /**
107 107 * Request header fields.
108 108 */
109   - protected Hashtable mRequestProperties;
  109 + protected Hashtable<String,String> mRequestProperties;
110 110
111 111 /**
112 112 * The proxy server name.
@@ -142,7 +142,7 @@
142 142 * Cookie storage, a hashtable (by site or host) of vectors of Cookies.
143 143 * This will be null if cookie processing is disabled (default).
144 144 */
145   - protected Hashtable mCookieJar;
  145 + protected Hashtable<String,Vector<Cookie>> mCookieJar;
146 146
147 147 /**
148 148 * The object to be notified prior to and after each connection.
@@ -172,7 +172,7 @@ public ConnectionManager ()
172 172 * Create a connection manager with the given connection properties.
173 173 * @param properties Name/value pairs to be added to the HTTP request.
174 174 */
175   - public ConnectionManager (Hashtable properties)
  175 + public ConnectionManager (Hashtable<String,String> properties)
176 176 {
177 177 mRequestProperties = properties;
178 178 mProxyHost = null;
@@ -199,7 +199,7 @@ public ConnectionManager (Hashtable properties)
199 199 * @see #mDefaultRequestProperties
200 200 * @see #setRequestProperties
201 201 */
202   - public static Hashtable getDefaultRequestProperties ()
  202 + public static Hashtable<String,String> getDefaultRequestProperties ()
203 203 {
204 204 return (mDefaultRequestProperties);
205 205 }
@@ -259,7 +259,7 @@ public static Hashtable getDefaultRequestProperties ()
259 259 * @see #mDefaultRequestProperties
260 260 * @see #setRequestProperties
261 261 */
262   - public static void setDefaultRequestProperties (Hashtable properties)
  262 + public static void setDefaultRequestProperties (Hashtable<String,String> properties)
263 263 {
264 264 mDefaultRequestProperties = properties;
265 265 }
@@ -270,7 +270,7 @@ public static void setDefaultRequestProperties (Hashtable properties)
270 270 * excluding proxy items, cookies and URL authorization.
271 271 * @return The request header properties for this connection manager.
272 272 */
273   - public Hashtable getRequestProperties ()
  273 + public Hashtable<String,String> getRequestProperties ()
274 274 {
275 275 return (mRequestProperties);
276 276 }
@@ -286,7 +286,7 @@ public Hashtable getRequestProperties ()
286 286 * Cookie property which is constructed from the current cookie jar.
287 287 * @param properties The new fixed properties.
288 288 */
289   - public void setRequestProperties (Hashtable properties)
  289 + public void setRequestProperties (Hashtable<String,String> properties)
290 290 {
291 291 mRequestProperties = properties;
292 292 }
@@ -423,7 +423,7 @@ public boolean getCookieProcessingEnabled ()
423 423 public void setCookieProcessingEnabled (boolean enable)
424 424 {
425 425 if (enable)
426   - mCookieJar = (null == mCookieJar) ? new Hashtable () : mCookieJar;
  426 + mCookieJar = (null == mCookieJar) ? new Hashtable<String,Vector<Cookie>> () : mCookieJar;
427 427 else
428 428 mCookieJar = null;
429 429 }
@@ -436,7 +436,7 @@ public void setCookieProcessingEnabled (boolean enable)
436 436 public void setCookie (Cookie cookie, String domain)
437 437 {
438 438 String path;
439   - Vector cookies;
  439 + Vector<Cookie> cookies;
440 440 Cookie probe;
441 441 boolean found; // flag if a cookie with current name is already there
442 442
@@ -444,14 +444,14 @@ public void setCookie (Cookie cookie, String domain)
444 444 domain = cookie.getDomain ();
445 445 path = cookie.getPath ();
446 446 if (null == mCookieJar)
447   - mCookieJar = new Hashtable (); // turn on cookie processing
448   - cookies = (Vector)mCookieJar.get (domain);
  447 + mCookieJar = new Hashtable<String,Vector<Cookie>> (); // turn on cookie processing
  448 + cookies = mCookieJar.get (domain);
449 449 if (null != cookies)
450 450 {
451 451 found = false;
452 452 for (int j = 0; j < cookies.size (); j++)
453 453 {
454   - probe = (Cookie)cookies.elementAt (j);
  454 + probe = cookies.elementAt (j);
455 455 if (probe.getName ().equalsIgnoreCase (cookie.getName ()))
456 456 {
457 457 // we keep paths sorted most specific to least
@@ -476,7 +476,7 @@ else if (path.startsWith (probe.getPath ()))
476 476 }
477 477 else
478 478 { // new cookie list needed
479   - cookies = new Vector ();
  479 + cookies = new Vector<Cookie> ();
480 480 cookies.addElement (cookie);
481 481 mCookieJar.put (domain, cookies);
482 482 }
@@ -557,8 +557,8 @@ public URLConnection openConnection (URL url)
557 557 boolean repeat;
558 558 int repeated;
559 559 Properties sysprops;
560   - Hashtable properties;
561   - Enumeration enumeration;
  560 + Hashtable<String,String> properties;
  561 + Enumeration<String> enumeration;
562 562 String key;
563 563 String value;
564 564 String set = null; // old proxySet value
@@ -613,8 +613,8 @@ public URLConnection openConnection (URL url)
613 613 for (enumeration = properties.keys ();
614 614 enumeration.hasMoreElements ();)
615 615 {
616   - key = (String)enumeration.nextElement ();
617   - value = (String)properties.get (key);
  616 + key = enumeration.nextElement ();
  617 + value = properties.get (key);
618 618 ret.setRequestProperty (key, value);
619 619 }
620 620
@@ -901,7 +901,7 @@ public URLConnection openConnection (String string)
901 901 */
902 902 public void addCookies (URLConnection connection)
903 903 {
904   - Vector list;
  904 + Vector<Cookie> list;
905 905 URL url;
906 906 String host;
907 907 String path;
@@ -918,14 +918,14 @@ public void addCookies (URLConnection connection)
918 918 path = "/";
919 919 if (null != host)
920 920 { // http://www.objectsdevelopment.com/portal/modules/freecontent/content/javawebserver.html
921   - list = addCookies ((Vector)mCookieJar.get (host), path, list);
  921 + list = addCookies (mCookieJar.get (host), path, list);
922 922 domain = getDomain (host);
923 923 if (null != domain)
924   - list = addCookies ((Vector)mCookieJar.get (domain),
  924 + list = addCookies (mCookieJar.get (domain),
925 925 path, list);
926 926 else
927 927 // maybe it is the domain we're accessing
928   - list = addCookies ((Vector)mCookieJar.get ("." + host),
  928 + list = addCookies (mCookieJar.get ("." + host),
929 929 path, list);
930 930 }
931 931 if (null != list)
@@ -941,7 +941,7 @@ public void addCookies (URLConnection connection)
941 941 * @param list The list of qualified cookies.
942 942 * @return The list of qualified cookies.
943 943 */
944   - protected Vector addCookies (Vector cookies, String path, Vector list)
  944 + protected Vector<Cookie> addCookies (Vector<Cookie> cookies, String path, Vector<Cookie> list)
945 945 {
946 946 Cookie cookie;
947 947 Date expires;
@@ -952,7 +952,7 @@ protected Vector addCookies (Vector cookies, String path, Vector list)
952 952 now = new Date ();
953 953 for (int i = 0; i < cookies.size (); i++)
954 954 {
955   - cookie = (Cookie)cookies.elementAt (i);
  955 + cookie = cookies.elementAt (i);
956 956 expires = cookie.getExpiryDate ();
957 957 if ((null != expires) && expires.before (now))
958 958 {
@@ -963,7 +963,7 @@ protected Vector addCookies (Vector cookies, String path, Vector list)
963 963 if (path.startsWith (cookie.getPath ()))
964 964 {
965 965 if (null == list)
966   - list = new Vector ();
  966 + list = new Vector<Cookie> ();
967 967 list.addElement (cookie);
968 968 }
969 969 }
@@ -1023,7 +1023,7 @@ protected String getDomain (String host)
1023 1023 * @return A string suitable for inclusion as the value of
1024 1024 * the "Cookie:" request property.
1025 1025 */
1026   - protected String generateCookieProperty (Vector cookies)
  1026 + protected String generateCookieProperty (Vector<Cookie> cookies)
1027 1027 {
1028 1028 int version;
1029 1029 Cookie cookie;
@@ -1036,7 +1036,7 @@ protected String generateCookieProperty (Vector cookies)
1036 1036 version = 0;
1037 1037 for (int i = 0; i < cookies.size (); i++)
1038 1038 version = Math.max (version,
1039   - ((Cookie)cookies.elementAt (i)).getVersion ());
  1039 + (cookies.elementAt (i)).getVersion ());
1040 1040 if (0 != version)
1041 1041 {
1042 1042 buffer.append ("$Version=\"");
@@ -1045,7 +1045,7 @@ protected String generateCookieProperty (Vector cookies)
1045 1045 }
1046 1046 for (int i = 0; i < cookies.size (); i++)
1047 1047 {
1048   - cookie = (Cookie)cookies.elementAt (i);
  1048 + cookie = cookies.elementAt (i);
1049 1049 if (0 != buffer.length ())
1050 1050 buffer.append ("; ");
1051 1051 buffer.append (cookie.getName ());
@@ -1086,7 +1086,7 @@ protected String generateCookieProperty (Vector cookies)
1086 1086 public void parseCookies (URLConnection connection)
1087 1087 {
1088 1088 String string;
1089   - Vector cookies;
  1089 + Vector<Cookie> cookies;
1090 1090 StringTokenizer tokenizer;
1091 1091 String token;
1092 1092 int index;
@@ -1109,7 +1109,7 @@ public void parseCookies (URLConnection connection)
1109 1109 // | "Path" "=" value
1110 1110 // | "Secure"
1111 1111 // | "Version" "=" 1*DIGIT
1112   - cookies = new Vector ();
  1112 + cookies = new Vector<Cookie> ();
1113 1113 tokenizer = new StringTokenizer (string, ";,", true);
1114 1114 cookie = null;
1115 1115 while (tokenizer.hasMoreTokens ())
@@ -1231,14 +1231,14 @@ else if (token.equals (","))
1231 1231 * @param list The list of cookies extracted from the response header.
1232 1232 * @param connection The connection (used when a cookie has no domain).
1233 1233 */
1234   - protected void saveCookies (Vector list, URLConnection connection)
  1234 + protected void saveCookies (Vector<Cookie> list, URLConnection connection)
1235 1235 {
1236 1236 Cookie cookie;
1237 1237 String domain;
1238 1238
1239 1239 for (int i = 0; i < list.size (); i++)
1240 1240 {
1241   - cookie = (Cookie)list.elementAt (i);
  1241 + cookie = list.elementAt (i);
1242 1242 domain = cookie.getDomain ();
1243 1243 if (null == domain)
1244 1244 domain = connection.getURL ().getHost ();
5 lexer/src/main/java/org/htmlparser/http/Cookie.java
@@ -65,6 +65,11 @@
5 lexer/src/main/java/org/htmlparser/lexer/Cursor.java
@@ -39,6 +39,11 @@
39 39 Cloneable
40 40 {
41 41 /**
  42 + *
  43 + */
  44 + private static final long serialVersionUID = 1L;
  45 +
  46 + /**
42 47 * This cursor's position.
43 48 */
44 49 protected int mPosition;
5 lexer/src/main/java/org/htmlparser/lexer/InputStreamSource.java
@@ -44,6 +44,11 @@
44 44 Source
45 45 {
46 46 /**
  47 + *
  48 + */
  49 + private static final long serialVersionUID = 1L;
  50 +
  51 + /**
47 52 * An initial buffer size.
48 53 * Has a default value of {16384}.
49 54 */
34 lexer/src/main/java/org/htmlparser/lexer/Lexer.java
@@ -30,6 +30,7 @@
30 30 import java.net.URLConnection;
31 31 import java.util.Vector;
32 32
  33 +import org.htmlparser.Attribute;
33 34 import org.htmlparser.Node;
34 35 import org.htmlparser.NodeFactory;
35 36 import org.htmlparser.Remark;
@@ -61,6 +62,11 @@
61 62 // This is done so as to facilitate ant script processing.
62 63
63 64 /**
  65 + *
  66 + */
  67 + private static final long serialVersionUID = 1L;
  68 +
  69 + /**
64 70 * The floating point version number ({@value}).
65 71 */
66 72 public static final double
@@ -658,7 +664,7 @@ public Remark createRemarkNode (Page page, int start, int end)
658 664 * @param attributes The attributes contained in this tag.
659 665 * @return The created Tag node.
660 666 */
661   - public Tag createTagNode (Page page, int start, int end, Vector attributes)
  667 + public Tag createTagNode (Page page, int start, int end, Vector<Attribute> attributes)
662 668 {
663 669 return (new TagNode (page, start, end, attributes));
664 670 }
@@ -905,7 +911,7 @@ protected Node makeString (int start, int end)
905 911 * @param attributes The list so far.
906 912 * @param bookmarks The array of positions.
907 913 */
908   - private void whitespace (Vector attributes, int[] bookmarks)
  914 + private void whitespace (Vector<Attribute> attributes, int[] bookmarks)
909 915 {
910 916 if (bookmarks[1] > bookmarks[0])
911 917 attributes.addElement (new PageAttribute (
@@ -917,7 +923,7 @@ private void whitespace (Vector attributes, int[] bookmarks)
917 923 * @param attributes The list so far.
918 924 * @param bookmarks The array of positions.
919 925 */
920   - private void standalone (Vector attributes, int[] bookmarks)
  926 + private void standalone (Vector<Attribute> attributes, int[] bookmarks)
921 927 {
922 928 attributes.addElement (new PageAttribute (
923 929 mPage, bookmarks[1], bookmarks[2], -1, -1, (char)0));
@@ -928,7 +934,7 @@ private void standalone (Vector attributes, int[] bookmarks)
928 934 * @param attributes The list so far.
929 935 * @param bookmarks The array of positions.
930 936 */
931   - private void empty (Vector attributes, int[] bookmarks)
  937 + private void empty (Vector<Attribute> attributes, int[] bookmarks)
932 938 {
933 939 attributes.addElement (new PageAttribute (
934 940 mPage, bookmarks[1], bookmarks[2], bookmarks[2] + 1, -1, (char)0));
@@ -939,7 +945,7 @@ private void empty (Vector attributes, int[] bookmarks)
939 945 * @param attributes The list so far.
940 946 * @param bookmarks The array of positions.
941 947 */
942   - private void naked (Vector attributes, int[] bookmarks)
  948 + private void naked (Vector<Attribute> attributes, int[] bookmarks)
943 949 {
944 950 attributes.addElement (new PageAttribute (
945 951 mPage, bookmarks[1], bookmarks[2], bookmarks[3],
@@ -951,7 +957,7 @@ private void naked (Vector attributes, int[] bookmarks)
951 957 * @param attributes The list so far.
952 958 * @param bookmarks The array of positions.
953 959 */
954   - private void single_quote (Vector attributes, int[] bookmarks)
  960 + private void single_quote (Vector<Attribute> attributes, int[] bookmarks)
955 961 {
956 962 attributes.addElement (new PageAttribute (
957 963 mPage, bookmarks[1], bookmarks[2], bookmarks[4] + 1,
@@ -963,7 +969,7 @@ private void single_quote (Vector attributes, int[] bookmarks)
963 969 * @param attributes The list so far.
964 970 * @param bookmarks The array of positions.
965 971 */
966   - private void double_quote (Vector attributes, int[] bookmarks)
  972 + private void double_quote (Vector<Attribute> attributes, int[] bookmarks)
967 973 {