net.smartlab.web
Class PropertiesEnumeration
java.lang.Object
net.smartlab.web.StringEnumeration
net.smartlab.web.PropertiesEnumeration
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable, org.hibernate.usertype.UserType
public abstract class PropertiesEnumeration
- extends StringEnumeration
This class allows to use a properties file to define enumeration elements but
needs the definition of two public constructors. Implementors of this class need to
define two constructors: one without parameters which simply calls
super()
and an additional one taking two strings and calling
super(String, String)
.
- Author:
- rlogiacco
- See Also:
- Serialized Form
Field Summary |
protected static org.apache.commons.logging.Log |
logger
Provides logging capabilities. |
Constructor Summary |
PropertiesEnumeration()
The empty public constructor which MUST be exposed by subclasses. |
PropertiesEnumeration(java.lang.String code,
java.lang.String display)
The parametrized public constructor which MUST be exposed by subclasses. |
Method Summary |
StringEnumeration |
decode(java.lang.String code)
Decodes a unique code into an instance of this class. |
Methods inherited from class net.smartlab.web.StringEnumeration |
assemble, compareTo, deepCopy, disassemble, equals, equals, getCode, getDisplay, hashCode, hashCode, isMutable, nullSafeGet, nullSafeSet, replace, returnedClass, sqlTypes |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
logger
protected static final org.apache.commons.logging.Log logger
- Provides logging capabilities.
PropertiesEnumeration
public PropertiesEnumeration()
- The empty public constructor which MUST be exposed by subclasses.
PropertiesEnumeration
public PropertiesEnumeration(java.lang.String code,
java.lang.String display)
- The parametrized public constructor which MUST be exposed by subclasses.
- Parameters:
code
- the enumeration element codedisplay
- the enumeration element display name
decode
public StringEnumeration decode(java.lang.String code)
- Description copied from class:
StringEnumeration
- Decodes a unique code into an instance of this class. This method can
not return
null
values, instead it should define a
default value.
- Specified by:
decode
in class StringEnumeration
- Parameters:
code
- the code to decode.
- Returns:
- an instance of this class.
- See Also:
StringEnumeration.decode(java.lang.String)
Copyright © 2004-2009 The SmartWeb Team. All Rights Reserved.