sourceInfo.parts.addElement (handler);
if ("LABEL".equals(upName)) { LabelTagHandler labelHandler = (LabelTagHandler)handler; sourceInfo.labels.put(labelHandler.getFor(), labelHandler.getContent()); } sourceInfo.parts.addElement(handler);
    private DataSourceInfo parsePage (DataSource source, ParseContext context)	throws IOException {	/*	 * read source contents. The SGMLTag requires	 * to read from a Reader which supports the	 * mark() operation so we need a BufferedReader	 * here.	 *	 * The PositionReader may be asked at which Position	 * it currently is (much like the java.io.LineNumberReader); this	 * is used to determine the exact position of the Tags in the	 * page to be able to loop through the fast copy/execute/copy	 * sequence in interpretPage().	 *	 * Since interpreting is operating on an InputStream which 	 * copies and skip()s bytes, any source position count done here 	 * assumes that sizeof(char) == sizeof(byte).	 * So we force the InputStreamReader to interpret the Stream's content	 * as ISO8859_1, because the localized default behaviour may	 * differ (e.g. UTF8 for which sizeof(char) != sizeof (byte)	 */	PositionReader fin = null;	// from JDK 1.1.6, the name of the encoding is ISO8859_1, but the old	// value is still accepted.	fin = new PositionReader (new BufferedReader (new InputStreamReader (source.getInputStream(),"8859_1")));	DataSourceInfo sourceInfo = new DataSourceInfo();       	try {	    // scan through page parsing SpecialTag statements	    sourceInfo.lastModified = source.lastModified();	    sourceInfo.parts = new Vector();	    long startPos;	    SGMLTag tag, endTag;	    long StartTime = System.currentTimeMillis();	    do {		endTag = null;		startPos = fin.getPosition();		tag = new SGMLTag(fin, false);		if (tag.getName() != null) {		    String upName = tag.getName().toUpperCase();		    if (handlerClasses.containsKey(upName)) {			SpecialTagHandler handler = null;			try {			    Class handlerClass;			    			    handlerClass = (Class)handlerClasses.get(upName);			    handler= (SpecialTagHandler) handlerClass				.newInstance();			    endTag=handler.parseTag(context,fin,startPos,tag);			}			catch (Exception e) {			    System.err.println (e.getMessage());			}			if (endTag != null) {			    sourceInfo.parts.addElement (handler);			}		    }		}	    } 	    while (!tag.finished());	    sourceInfo.parseTime = System.currentTimeMillis() - StartTime;	    /***		System.err.println ("PageParser: parsing '" + 		source.getCanonicalName() + "' took " + 		sourceInfo.parseTime + "ms for " +		sourceInfo.parts.size() + " handlers");	    ***/	}	finally {	    if (fin != null) fin.close();	}	return sourceInfo;    }