FeedbackManager.java
1 // HTMLParser Library $Name: v1_6_20060319 $ - A java-based parser for HTML 2 // http://sourceforge.org/projects/htmlparser 3 // Copyright (C) 2004 Claude Duguay 4 // 5 // Revision Control Information 6 // 7 // $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/FeedbackManager.java,v $ 8 // $Author: derrickoswald $ 9 // $Date: 2004/01/02 16:24:58 $ 10 // $Revision: 1.44 $ 11 // 12 // This library is free software; you can redistribute it and/or 13 // modify it under the terms of the GNU Lesser General Public 14 // License as published by the Free Software Foundation; either 15 // version 2.1 of the License, or (at your option) any later version. 16 // 17 // This library is distributed in the hope that it will be useful, 18 // but WITHOUT ANY WARRANTY; without even the implied warranty of 19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 // Lesser General Public License for more details. 21 // 22 // You should have received a copy of the GNU Lesser General Public 23 // License along with this library; if not, write to the Free Software 24 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 // 26 27 package org.htmlparser.util; 28 29 /** 30 * Implementaiton of static methods that allow the parser to 31 * route various messages to any implementation of the 32 * HTMLParserFeedback interface. End users can use the default 33 * DefaultHTMLParserFeedback or may provide their own by calling 34 * the setParserFeedback method. 35 * 36 * @see ParserFeedback 37 * @see DefaultParserFeedback 38 **/ 39 40 public class FeedbackManager 41 { 42 protected static ParserFeedback callback = 43 new DefaultParserFeedback(); 44 45 public static void setParserFeedback(ParserFeedback feedback) 46 { 47 callback = feedback; 48 } 49 50 public static void info(String message) 51 { 52 callback.info(message); 53 } 54 55 public static void warning(String message) 56 { 57 callback.warning(message); 58 } 59 60 public static void error(String message, ParserException e) 61 { 62 callback.error(message, e); 63 } 64 }