All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.metawidget.config.iface.NeedsResourceResolver Maven / Gradle / Ivy

The newest version!
// Metawidget
//
// This file is dual licensed under both the LGPL
// (http://www.gnu.org/licenses/lgpl-2.1.html) and the EPL
// (http://www.eclipse.org/org/documents/epl-v10.php). As a
// recipient of Metawidget, you may choose to receive it under either
// the LGPL or the EPL.
//
// Commercial licenses are also available. See http://metawidget.org
// for details.

package org.metawidget.config.iface;


/**
 * Interface to indicate a xxxConfig class (ie. an InspectorConfig, a
 * LayoutConfig etc) needs a ResourceResolver. ConfigReader automatically
 * recognises classes implementing NeedsResourceResolver and passes itself to them.
 * 

* Note: this class is not located under org.metawidget.iface, because GWT does not * like ResourceResolver's java.io.InputStream. * * @author Richard Kennard */ public interface NeedsResourceResolver { // // Methods // /** * Set the ResourceResolver for this class. *

* Note: we tried removing this interface, and having ConfigReader look for * xxxConfig classes that took a ResourceResolver parameter in their * constructor instead. This had disadvantages: *

*

    *
  • you start dictating how a class' constructor must look, which degrades the POJO approach
  • *
  • you end up using reflection to determine what constructor parameters there are. In * general, an API should favour interfaces over reflection
  • *
  • you require clients to think about ResourceResolver when constructing the class * programmatically. They can pass null, but this really calls for a default constructor. But if * you have a default constructor, all subclasses must implement two constructors, and many must * therefore make two calls to setDefaultFile
  • *
*/ void setResourceResolver( ResourceResolver resourceResolver ); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy