- All Known Implementing Classes:
public interface InstanceInitializer
Note that this is only needed when the object can't be created with a
no-arguments constructor. In that case, the
InstanceManagerAutoDefault mechanism is a better choice.
Instances of this class will normally be used only if they are annotated with
@ServiceProvider(service = InstanceInitializer.class)
JMRI 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 General Public License for more details.
Provide a default instance of the given class.
Note calling this method twice for the same class should not be expected to return the same instance; however, there is no guarantee that the same instance will not be returned for two calls to this method.
- Type Parameters:
T- the class to get the default for
type- the class to get the default for
- the newly created default for the given class
IllegalArgumentException- if creating an instance of type is not supported by this InstanceInitalizer
Get the set of classes for which this InstanceInitializer can provide default instances for.
- the set of classes this InstanceInitalizer supports; if empty,
getDefault(java.lang.Class)will never be called.