Package jmri.configurexml
Class AbstractXmlAdapter.EnumIO<T extends java.lang.Enum<T>>
- java.lang.Object
-
- jmri.configurexml.AbstractXmlAdapter.EnumIO<T>
-
- Direct Known Subclasses:
AbstractXmlAdapter.EnumIoMapped
,AbstractXmlAdapter.EnumIoNames
,AbstractXmlAdapter.EnumIoOrdinals
- Enclosing class:
- AbstractXmlAdapter
public abstract static class AbstractXmlAdapter.EnumIO<T extends java.lang.Enum<T>> extends java.lang.Object
Base for support of Enum load/store to XML files.
-
-
Constructor Summary
Constructors Constructor Description EnumIO()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
inputFromAttribute(org.jdom2.Attribute a)
Convert a JDOM Attribute from an XML file to an enum valueabstract T
inputFromString(java.lang.String s)
Convert a String value from an XML file to an enum value.abstract java.lang.String
outputFromEnum(T e)
Convert an enum value to a String for storage in an XML file.
-
-
-
Constructor Detail
-
EnumIO
public EnumIO()
-
-
Method Detail
-
outputFromEnum
@Nonnull public abstract java.lang.String outputFromEnum(@Nonnull T e)
Convert an enum value to a String for storage in an XML file.- Parameters:
e
- enum value.- Returns:
- storage string.
-
inputFromString
@Nonnull public abstract T inputFromString(@CheckForNull java.lang.String s)
Convert a String value from an XML file to an enum value.- Parameters:
s
- storage string- Returns:
- enum value.
-
inputFromAttribute
@Nonnull public T inputFromAttribute(@Nonnull org.jdom2.Attribute a)
Convert a JDOM Attribute from an XML file to an enum value- Parameters:
a
- JDOM attribute.- Returns:
- enum value.
-
-