[Htmlparser-cvs] htmlparser/src/org/htmlparser/util ChainedException.java,1.35,1.36 NodeList.java,1.
Brought to you by:
derrickoswald
From: <der...@us...> - 2003-08-23 19:15:11
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util In directory sc8-pr-cvs1:/tmp/cvs-serv20167/util Modified Files: ChainedException.java NodeList.java Log Message: Sixth drop for new i/o subsystem. Isolated htmllexer.jar file and made it compileable and runnable on JDK 1.1 systems. The build.xml file now has four new targets for separate compiling and jaring of the lexer and parser. Significantly refactored the existing Node interface and AbstractNode class to achieve isolation. They now support get/setChildren(), rather than CompositeTag. Various scanners that were directly accessing the childTags node list were affected. The get/setParent is now a generic Node rather than a CompositeTag. The visitor accept() signature was changed to Object to avoid dragging in visitors code. This was *not* changed on classes derived from Tag, although it could be. ChainedException now uses/returns a Vector. Removed the cruft from lexer nodes where possible. Index: ChainedException.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/ChainedException.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ChainedException.java 11 Aug 2003 00:18:35 -0000 1.35 --- ChainedException.java 23 Aug 2003 17:14:46 -0000 1.36 *************** *** 65,70 **** import java.io.PrintStream; import java.io.PrintWriter; ! import java.util.ArrayList; ! import java.util.List; public class ChainedException --- 65,69 ---- import java.io.PrintStream; import java.io.PrintWriter; ! import java.util.Vector; public class ChainedException *************** *** 93,109 **** public String[] getMessageChain() { ! List list = getMessageList(); String[] chain = new String[list.size()]; ! for (int i = 0; i < list.size(); i++) ! { ! chain[i] = (String)list.get(i); ! } return chain; } ! public List getMessageList() { ! ArrayList list = new ArrayList(); ! list.add(getMessage()); if (throwable != null) { --- 92,105 ---- public String[] getMessageChain() { ! Vector list = getMessageList(); String[] chain = new String[list.size()]; ! list.copyInto (chain); return chain; } ! public Vector getMessageList() { ! Vector list = new Vector(); ! list.addElement(getMessage()); if (throwable != null) { *************** *** 111,115 **** { ChainedException chain = (ChainedException)throwable; ! list.addAll(chain.getMessageList()); } else --- 107,113 ---- { ChainedException chain = (ChainedException)throwable; ! Vector sublist = chain.getMessageList (); ! for (int i = 0; i < sublist.size (); i++) ! list.addElement (sublist.elementAt (i)); } else *************** *** 118,122 **** if (message != null && !message.equals("")) { ! list.add(message); } } --- 116,120 ---- if (message != null && !message.equals("")) { ! list.addElement (message); } } Index: NodeList.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/NodeList.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** NodeList.java 11 Aug 2003 00:18:36 -0000 1.38 --- NodeList.java 23 Aug 2003 17:14:46 -0000 1.39 *************** *** 33,37 **** import org.htmlparser.Node; - import org.htmlparser.tags.CompositeTag; public class NodeList implements Serializable { --- 33,36 ---- *************** *** 183,186 **** --- 182,186 ---- String name; Node node; + NodeList children; NodeList ret; *************** *** 192,197 **** if (node.getClass ().getName ().equals (name)) ret.add (node); ! if (recursive && node instanceof CompositeTag) ! ret.add (((CompositeTag)node).getChildren ().searchFor (classType, recursive)); } --- 192,201 ---- if (node.getClass ().getName ().equals (name)) ret.add (node); ! if (recursive) ! { ! children = node.getChildren (); ! if (null != children) ! ret.add (children.searchFor (classType, recursive)); ! } } |