Revision: 2711 http://archive-access.svn.sourceforge.net/archive-access/?rev=2711&view=rev Author: bradtofel Date: 2009-05-20 01:55:41 +0000 (Wed, 20 May 2009) Log Message: ----------- INITIAL REV: new base class which most implementation classes will inherit from: should simplify configuration of CompositeRequestParsers -- each implementation class will now get configuration from the delegate instance. Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/requestparser/WrappedRequestParser.java Added: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/requestparser/WrappedRequestParser.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/requestparser/WrappedRequestParser.java (rev 0) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/requestparser/WrappedRequestParser.java 2009-05-20 01:55:41 UTC (rev 2711) @@ -0,0 +1,73 @@ +/* WrappedRequestParser + * + * $Id$ + * + * Created on 11:53:19 AM Apr 9, 2009. + * + * Copyright (C) 2009 Internet Archive. + * + * This file is part of wayback. + * + * wayback is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * wayback is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with wayback; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package org.archive.wayback.requestparser; + +/** + * Abstract subclass of BaseRequestParser, which allows retrieving + * configured maxRecords, and earliest and latest timestamp config from an + * delegate instance. + * + * This class is intended to be overridden and used in conjunction with a + * CompositeRequestParser: The CompositeRequestParser(or subclass thereof) will + * hold actual configuration data, and all composed RequestParsers will inherit + * from this, accessing the configured data on the wrapped instance. + * + * For examples, please see {Path,Form,OpenSearch,Composite}RequestParser in + * this package. + * + * @author brad + * @version $Date$, $Revision$ + */ + +public abstract class WrappedRequestParser extends BaseRequestParser { + + private BaseRequestParser wrapped = null; + + public WrappedRequestParser(BaseRequestParser wrapped) { + this.wrapped = wrapped; + } + + /** + * @return + * @see org.archive.wayback.requestparser.BaseRequestParser#getEarliestTimestamp() + */ + public String getEarliestTimestamp() { + return wrapped.getEarliestTimestamp(); + } + /** + * @return + * @see org.archive.wayback.requestparser.BaseRequestParser#getLatestTimestamp() + */ + public String getLatestTimestamp() { + return wrapped.getLatestTimestamp(); + } + /** + * @return + * @see org.archive.wayback.requestparser.BaseRequestParser#getMaxRecords() + */ + public int getMaxRecords() { + return wrapped.getMaxRecords(); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |