Package jmri.managers
Class AbstractStringIOManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.beans.VetoableChangeSupport
-
- jmri.managers.AbstractManager<StringIO>
-
- jmri.managers.AbstractStringIOManager
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.beans.VetoableChangeListener
,java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
,SilenceablePropertyChangeProvider
,VetoableChangeFirer
,VetoableChangeProvider
,Manager<StringIO>
,NameIncrementingManager
,ProvidingManager<StringIO>
,StringIOManager
- Direct Known Subclasses:
InternalStringIOManager
,LnStringIOManager
,OlcbStringIOManager
public abstract class AbstractStringIOManager extends AbstractManager<StringIO> implements StringIOManager
Abstract partial implementation of a StringIOManager.Based on AbstractSignalHeadManager.java and AbstractSensorManager.java
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.Manager
Manager.ManagerDataEvent<E extends NamedBean>, Manager.ManagerDataListener<E extends NamedBean>, Manager.NameValidity
-
-
Field Summary
-
Fields inherited from class jmri.managers.AbstractManager
_beans, _tsys, _tuser, lastAutoNamedBeanRef, memo, paddedNumber, silenceableProperties, silencedProperties
-
Fields inherited from class jmri.beans.VetoableChangeSupport
vetoableChangeSupport
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
Fields inherited from interface jmri.Manager
ANALOGIOS, AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, CTCDATA, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXNG_ANALOG_ACTIONS, LOGIXNG_ANALOG_EXPRESSIONS, LOGIXNG_CONDITIONALNGS, LOGIXNG_DIGITAL_ACTIONS, LOGIXNG_DIGITAL_BOOLEAN_ACTIONS, LOGIXNG_DIGITAL_EXPRESSIONS, LOGIXNG_GLOBAL_VARIABLES, LOGIXNG_MODULES, LOGIXNG_STRING_ACTIONS, LOGIXNG_STRING_EXPRESSIONS, LOGIXNG_TABLES, LOGIXNGS, LOGIXS, MEMORIES, METERFRAMES, METERS, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, STRINGIOS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS
-
-
Constructor Summary
Constructors Constructor Description AbstractStringIOManager(SystemConnectionMemo memo)
Create a new StringIOManager instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract StringIO
createNewStringIO(java.lang.String systemName, java.lang.String userName)
Internal method to invoke the factory and create a new StringIO.java.lang.String
getBeanTypeHandled(boolean plural)
Get bean type handled.java.lang.String
getEntryToolTip()
Get a manager-specific tool tip for adding an entry to the manager.java.lang.Class<StringIO>
getNamedBeanClass()
Get the class of NamedBean supported by this Manager.StringIO
getStringIO(java.lang.String name)
Get an existing StringIO or return null if it doesn't exist.int
getXMLOrder()
Determine the order that types should be written when storing panel files.StringIO
newStringIO(java.lang.String systemName, java.lang.String userName)
Create a New StringIO.StringIO
provideStringIO(java.lang.String name)
char
typeLetter()
-
Methods inherited from class jmri.managers.AbstractManager
addDataListener, checkNumeric, createSystemName, deleteBean, deregister, dispose, fireDataListenersAdded, fireDataListenersRemoved, fireVetoableChange, getAutoSystemName, getBySystemName, getBySystemName, getByUserName, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getOuterBean, getSystemPrefix, handleUserNameUniqueness, makeSystemName, propertyChange, register, registerSelf, registerUserName, removeDataListener, setDataListenerMute, setPropertyChangesSilenced, setRegisterSelf, updateAutoNumber, validSystemNameFormat, vetoableChange
-
Methods inherited from class jmri.beans.VetoableChangeSupport
addVetoableChangeListener, addVetoableChangeListener, fireVetoableChange, fireVetoableChange, fireVetoableChange, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.Manager
addDataListener, deleteBean, deregister, dispose, getBeanTypeHandled, getBySystemName, getByUserName, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getSubSystemNamePrefix, getSystemNamePrefix, getSystemPrefix, isValidSystemNameFormat, makeSystemName, makeSystemName, makeSystemName, register, removeDataListener, setDataListenerMute, validateBadCharsInSystemNameFormat, validateIntegerSystemNameFormat, validateNmraAccessorySystemNameFormat, validateSystemNameFormat, validateSystemNameFormat, validateSystemNameFormatOnlyNumeric, validateSystemNamePrefix, validateTrimmedMin1NumberSystemNameFormat, validateTrimmedSystemNameFormat, validateUppercaseTrimmedSystemNameFormat, validSystemNameFormat
-
Methods inherited from interface jmri.NameIncrementingManager
allowMultipleAdditions, getNextValidSystemName
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface jmri.beans.SilenceablePropertyChangeProvider
setPropertyChangesSilenced
-
Methods inherited from interface jmri.StringIOManager
provide
-
Methods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Constructor Detail
-
AbstractStringIOManager
public AbstractStringIOManager(SystemConnectionMemo memo)
Create a new StringIOManager instance.- Parameters:
memo
- the system connection
-
-
Method Detail
-
getXMLOrder
public int getXMLOrder()
Determine the order that types should be written when storing panel files. Uses one of the constants defined in this class.Yes, that's an overly-centralized methodology, but it works for now.
- Specified by:
getXMLOrder
in interfaceManager<StringIO>
- Returns:
- write order for this Manager; larger is later.
-
provideStringIO
@Nonnull public StringIO provideStringIO(@Nonnull java.lang.String name)
- Specified by:
provideStringIO
in interfaceStringIOManager
-
getStringIO
public StringIO getStringIO(@Nonnull java.lang.String name)
Description copied from interface:StringIOManager
Get an existing StringIO or return null if it doesn't exist. Locates via user name, then system name if needed.- Specified by:
getStringIO
in interfaceStringIOManager
- Parameters:
name
- User name or system name to match- Returns:
- null if no match found
-
newStringIO
@Nonnull public final StringIO newStringIO(@Nonnull java.lang.String systemName, java.lang.String userName) throws java.lang.IllegalArgumentException
Create a New StringIO. Return a StringIO with the specified user or system name. Return StringIO by UserName else provide by SystemName.Note that two calls with the same arguments will get the same instance; there is only one StringIO object with a specific system or user name.
This will always return a valid object reference; a new object will be created if necessary. If that's not possible, an IllegalArgumentException is thrown.
If a new object has to be created:
- If a null reference is given for user name, no user name will be associated with the Sensor object created; a valid system name must be provided
- If both names are provided, the system name defines the hardware access of the desired sensor, and the user address is associated with it. The system name must be valid.
- Specified by:
newStringIO
in interfaceStringIOManager
- Parameters:
systemName
- the desired system nameuserName
- the desired user name- Returns:
- requested StringIO object
- Throws:
java.lang.IllegalArgumentException
- if cannot create the StringIO due to e.g. an illegal name or name that can't be parsed.
-
typeLetter
public char typeLetter()
- Specified by:
typeLetter
in interfaceManager<StringIO>
- Returns:
- The type letter for a specific implementation
-
getBeanTypeHandled
@Nonnull public java.lang.String getBeanTypeHandled(boolean plural)
Get bean type handled.- Specified by:
getBeanTypeHandled
in interfaceManager<StringIO>
- Parameters:
plural
- true to return plural form of the type; false to return singular form- Returns:
- a string for the type of object handled by this manager
-
getNamedBeanClass
public java.lang.Class<StringIO> getNamedBeanClass()
Get the class of NamedBean supported by this Manager. This should be the generic class used in the Manager's class declaration.- Specified by:
getNamedBeanClass
in interfaceManager<StringIO>
- Returns:
- the class supported by this Manager.
-
createNewStringIO
@Nonnull protected abstract StringIO createNewStringIO(@Nonnull java.lang.String systemName, java.lang.String userName) throws java.lang.IllegalArgumentException
Internal method to invoke the factory and create a new StringIO. Called after all the logic for returning an existing StringIO has been invoked. An existing SystemName is not found, existing UserName not found. Implementing classes should base StringIO on the system name, then add user name.- Parameters:
systemName
- the system name to use for the new StringIOuserName
- the optional user name to use for the new StringIO- Returns:
- the new StringIO
- Throws:
java.lang.IllegalArgumentException
- if unsuccessful with reason for fail.
-
getEntryToolTip
public java.lang.String getEntryToolTip()
Get a manager-specific tool tip for adding an entry to the manager.- Specified by:
getEntryToolTip
in interfaceManager<StringIO>
- Returns:
- the tool tip or null to disable the tool tip
-
-