Class AbstractInstanceInitializer

java.lang.Object
jmri.implementation.AbstractInstanceInitializer
All Implemented Interfaces:
InstanceInitializer
Direct Known Subclasses:
DebuggerInstanceInitializer, DecoderIndexFile.Initializer, DefaultCatalogTreeManager.Initializer, DefaultIdTagManager.Initializer, DefaultInstanceInitializer, DeferringProgrammerManager.Initializer, EngineModels.Initializer, ImageIndexEditor.Initializer, JmriUserPreferencesManager.Initializer, LogixNG_AnalogInstanceInitializer, LogixNG_DigitalInstanceInitializer, LogixNG_InstanceInitializer, LogixNG_StringInstanceInitializer, NameFile.Initializer, PermissionInstanceInitializer, Server.Initializer, ServerFrame.Initializer, ShutDownManagerInitializer, TrackerTableAction.Initializer, WiThrottlePreferences.Initializer

  • Constructor Details

  • Method Details

    • getDefault

      @Nonnull public <T> Object getDefault(@Nonnull Class<T> type)
      The default implementation always throws an IllegalArgumentException. If called by an overriding method, the last line of the overriding method should be return super.getDefault(type);. 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.

      Specified by:
      getDefault in interface InstanceInitializer
      Type Parameters:
      T - the class to get the default for
      Parameters:
      type - the class to get the default for
      Returns:
      the newly created default for the given class
    • getInitalizes

      The default implementation returns an empty set. Get the set of classes for which this InstanceInitializer can provide default instances for.
      Specified by:
      getInitalizes in interface InstanceInitializer
      Returns:
      the set of classes this InstanceInitalizer supports; if empty, InstanceInitializer.getDefault(java.lang.Class) will never be called.