PanelFactory.java :  » Web-Server » simple » simple » template » layout » Java Open Source

Java Open Source » Web Server » simple 
simple » simple » template » layout » PanelFactory.java
/*
 * PanelFactory.java March 2005
 *
 * Copyright (C) 2005, Niall Gallagher <niallg@users.sf.net>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This library 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 General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General 
 * Public License along with this library; if not, write to the 
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
 * Boston, MA  02111-1307  USA
 */

package simple.template.layout;

/**
 * The <code>PanelFactory</code> serves to resolve a document
 * instance from a specified path. The location of the document
 * is dependant on the implementation. Panels created by an
 * implementation of the <code>PanelFactory</code> typically
 * wrap a <code>Viewer</code> produced from an implementation of
 * the <code>ViewerFactory</code>. This structure ensures that
 * the integration of new templating systems is easy, the system
 * need only adhere to some simple interfaces to be compatible. 
 *
 * @author Niall Gallagher 
 */
interface PanelFactory {
        
   /**
    * Creates a new <code>Panel</code> object, which wraps the
    * referenced template. Resolving the location of the template 
    * to load is left up the implementation. The document created
    * by this method is transient, that is, it exists locally only.
    * This means that changes to the properties of any created 
    * document object affect only that instance. All documents
    * retrieved will use the UTF-8 character encoding. 
    * 
    * @param name the name or path used to locate the template
    * @param data the data source object to use for properties
    * @param share should the data model be inherited or shared
    */
   public Panel getInstance(String name, Object data, boolean share) throws Exception;
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.