Package jmri.util.startup
Interface StartupActionFactory
-
- All Superinterfaces:
JmriServiceProviderInterface
- All Known Implementing Classes:
AbstractStartupActionFactory,AnalogClockStartupActionFactory,AppsStartupActionFactory,AutomatTableStartupActionFactory,BeanTableStartupActionFactory,BlockBossStartupActionFactory,ConfigureXmlStartupActionFactory,ConsistToolStartupActionFactory,CtcEditorStartup,CtcRunStartup,DispatcherStartupActionFactory,DualDecoderStartupActionFactory,JmriSRCPStartupActionFactory,JsonServerStartupActionFactory,JythonStartupActionFactory,LcdClockStartupActionFactory,LnTcpStartupActionFactory,MeterStartupActionFactory,NixieClockStartupActionFactory,OperationsStartupActionFactory,PanelStartupActionFactory,PowerStartupActionFactory,ResourceBundleStartupActionFactory,RosterFrameStartupActionFactory,RosterStartupActionFactory,SampleConfigStartUpActionFactory,SendPacketStartupActionFactory,ServerStartupActionFactory,SimpleClockStartupActionFactory,SimpleLightCtrlStartupActionFactory,SimpleProgStartupActionFactory,SimpleServerStartupActionFactory,SimpleTurnoutCtrlStartupActionFactory,SpeedometerStartupActionFactory,SpeedoStartupActionFactory,SymbolicProgStartupActionFactory,TabbedPreferencesActionFactory,TcpServerStartupActionFactory,ThrottleStartupActionFactory,TimeTableStartup,ToolsStartupActionFactory,TreeControlStartupActionFactory,UsbBrowserStartupActionFactory,VSDecoderCreationStartupActionFactory,WebServerStartupActionFactory,WiThrottleStartupActionFactory,Z21serverStartupActionFactory
public interface StartupActionFactory extends JmriServiceProviderInterface
Provide an SPI for registering potential startup actions with theStartupActionsManager.Instances of this class need to be registered with a
ServiceLoader. The best way to register is include a fileMETA-INF/services/jmri.util.startup.StartupActionFactoryin the classpath (preferably in a JAR with the action the instance supports). JMRI code uses theServiceProviderannotation to generate that file.AbstractStartupActionFactoryprovides an abstract base class for creating factories that implements most of the boilerplate needed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Class<?>[]getActionClasses()Get the classes this factory supports.java.lang.String[]getOverriddenClasses(java.lang.Class<?> clazz)Get startup actions overridden by the given class.java.lang.StringgetTitle(java.lang.Class<?> clazz)Get the title for the given class using the default locale.java.lang.StringgetTitle(java.lang.Class<?> clazz, java.util.Locale locale)Get the title for the given class.
-
-
-
Method Detail
-
getTitle
@Nonnull java.lang.String getTitle(@Nonnull java.lang.Class<?> clazz) throws java.lang.IllegalArgumentException
Get the title for the given class using the default locale.- Parameters:
clazz- the class- Returns:
- the title
- Throws:
java.lang.IllegalArgumentException- if the class is not supported by this factory
-
getTitle
@Nonnull java.lang.String getTitle(@Nonnull java.lang.Class<?> clazz, @Nonnull java.util.Locale locale) throws java.lang.IllegalArgumentException
Get the title for the given class.- Parameters:
clazz- the classlocale- the desired locale for the title- Returns:
- the title in the given locale
- Throws:
java.lang.IllegalArgumentException- if the class is not supported by this factory
-
getActionClasses
@Nonnull java.lang.Class<?>[] getActionClasses()
Get the classes this factory supports.- Returns:
- the supported classes or an empty array
-
getOverriddenClasses
@Nonnull java.lang.String[] getOverriddenClasses(@Nonnull java.lang.Class<?> clazz) throws java.lang.IllegalArgumentException
Get startup actions overridden by the given class. This is designed to allow a new class to replace a deprecated class.Note: the behavior is undefined if multiple classes override a single class.
- Parameters:
clazz- the overriding class- Returns:
- the overridden classes or an empty array
- Throws:
java.lang.IllegalArgumentException- if the class is not supported by this factory
-
-