1 /* 2 * Copyright 1999,2004 The Apache Software Foundation. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.apache.commons.feedparser; 18 19 import java.io.InputStream; 20 21 /** 22 * This FeedParser implementation is based on JDOM and Jaxen and is based around 23 * XPath and JDOM iteration. While the implementation is straight forward it 24 * has not been optimized for performance. A SAX based parser would certainly 25 * be less memory intensive but with the downside of being harder to develop. 26 * 27 * @author <a href="mailto:burton@apache.org">Kevin A. Burton (burtonator)</a> 28 * @version $Id: FeedParser.java 155416 2005-02-26 13:00:10Z dirkv $ 29 */ 30 public interface FeedParser { 31 32 /** 33 * Parse this feed. 34 * 35 * @param resource The URL of the feed being parsed. This is optional and 36 * may be null but is used when an exception is thrown to aid debugging. 37 * 38 */ 39 public void parse( FeedParserListener listener, 40 InputStream is , 41 String resource ) throws FeedParserException; 42 43 /** 44 * @deprecated Use #parse( FeedParserException, InputStream, String ) 45 */ 46 public void parse( FeedParserListener listener, 47 InputStream is ) throws FeedParserException; 48 49 /** 50 * Parse this feed. 51 * 52 */ 53 public void parse( FeedParserListener listener, 54 org.jdom.Document doc ) throws FeedParserException; 55 56 } 57