Expresso 5-6

com.jcorporate.expresso.core.dbobj
Class ISOValidValue

java.lang.Object
  extended bycom.jcorporate.expresso.core.dbobj.ValidValue
      extended bycom.jcorporate.expresso.core.dbobj.ISOValidValue
All Implemented Interfaces:
Cacheable, Cloneable, Serializable

public class ISOValidValue
extends ValidValue

An ISO valid value is a enumerated collection very similar to a pure Struts label and value bean with internationalization (i18n) support. It typically represent an item of data that is displayed in a drop-down list box or a menu selection. A valid value has a real value as known as a key and description.

To support internationalisation (i18n) the description field also has a dual role. The description field is used a look-up key into a resource bundle during canonisation.

Version:
$Id: ISOValidValue.java,v 1.7 2004/11/18 02:03:27 lhamel Exp $
Author:
Peter A. Pilgrim, Fri Dec 27 22:33:27 GMT 2002, Created XeNoNSoFT.com
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.jcorporate.expresso.core.dbobj.ValidValue
ValidValue.DescriptionComparator, ValidValue.ValueComparator
 
Field Summary
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.ValidValue
description, value
 
Constructor Summary
ISOValidValue()
          Default constructor for creating a valid value.
ISOValidValue(RequestContext request, String schemaClass, String prefix, String value, String description)
          Constructor of valid value enumeration which automatically canonizes the description attribute if it can be found in�the schema resource bundle
ISOValidValue(String schemaClass, Locale locale, String prefix, String value, String description)
          Constructor of valid value enumeration which automatically canonizes the description attribute if it can be found in�the schema resource bundle
ISOValidValue(String newValue, String newDescrip)
          Original constructor for creating a valid value.
ISOValidValue(String schemaClass, String prefix, String value, String description)
          Constructor of valid value enumeration which automatically canonizes the description attribute if it can be found in�the schema resource bundle in�the default locale
 
Method Summary
 String canonize(RequestContext request, String schemaClass, String prefix)
          This is method will attempt to convert the description attribute into a localised value string from a message resource bundle.
 String canonize(String schemaClass, Locale locale, String prefix)
          This is method will attempt to convert the description attribute into a localised value string from a message resource bundle.
 String canonize(String schemaClass, String prefix)
          This is method will attempt to convert the description attribute into a the default locale value string from a message resource bundle.
 String getDescription()
          Gets the description of the valid value
 String getKey()
          Gets the real value of the valid value as a cache key
 String getValue()
          Gets the real value of the valid value
 void setDescription(String description)
          Sets the real description of the valid value
 void setValue(String value)
          Sets the real value of the valid value
 String toString()
          Human readable string for debugging
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.ValidValue
clone, equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ISOValidValue

public ISOValidValue()
Default constructor for creating a valid value. Please note: no canonization takes place within this method.


ISOValidValue

public ISOValidValue(String newValue,
                     String newDescrip)
Original constructor for creating a valid value. Please note: no canonization takes place within this method.

Parameters:
newValue - the real value of the enumeration
newDescrip - the description of the enumeration

ISOValidValue

public ISOValidValue(String schemaClass,
                     String prefix,
                     String value,
                     String description)
Constructor of valid value enumeration which automatically canonizes the description attribute if it can be found in�the schema resource bundle in�the default locale

Parameters:
schemaClass - the fully qualified class name of the schema
prefix - the optional prefix argument
value - the real value string of the enumeration
description - the description string of the enumeration that is used as look-up key in�the resource bundle
See Also:
canonize( String schemaClass, Locale locale, String prefix )

ISOValidValue

public ISOValidValue(String schemaClass,
                     Locale locale,
                     String prefix,
                     String value,
                     String description)
Constructor of valid value enumeration which automatically canonizes the description attribute if it can be found in�the schema resource bundle

Parameters:
schemaClass - the fully qualified class name of the schema
locale - the locale
prefix - the optional prefix argument
value - the real value string of the enumeration
description - the description string of the enumeration that is used as look-up key in�the resource bundle
See Also:
canonize( String schemaClass, Locale locale, String prefix )

ISOValidValue

public ISOValidValue(RequestContext request,
                     String schemaClass,
                     String prefix,
                     String value,
                     String description)
Constructor of valid value enumeration which automatically canonizes the description attribute if it can be found in�the schema resource bundle

Parameters:
schemaClass - the fully qualified class name of the schema
request - the request context
prefix - the optional prefix argument
value - the real value string of the enumeration
description - the description string of the enumeration that is used as look-up key in�the resource bundle
See Also:
canonize( RequestContext request, String schemaClass, String prefix )
Method Detail

getValue

public String getValue()
Gets the real value of the valid value

Overrides:
getValue in class ValidValue
Returns:
the value string
See Also:
setValue(java.lang.String)

setValue

public void setValue(String value)
Sets the real value of the valid value

Overrides:
setValue in class ValidValue
Parameters:
value - the new value string
See Also:
getValue()

getKey

public String getKey()
Gets the real value of the valid value as a cache key

Specified by:
getKey in interface Cacheable
Overrides:
getKey in class ValidValue
Returns:
the value string as a cache key
See Also:
getValue()

getDescription

public String getDescription()
Gets the description of the valid value

Overrides:
getDescription in class ValidValue
Returns:
the description

setDescription

public void setDescription(String description)
Sets the real description of the valid value

Overrides:
setDescription in class ValidValue
Parameters:
description - the new description string
See Also:
getDescription()

canonize

public String canonize(String schemaClass,
                       String prefix)
This is method will attempt to convert the description attribute into a the default locale value string from a message resource bundle. If the prefix parameter is not null then the description attribute is prepended with a full stop "." to the original description string to make a new look up key. Otherwise if the prefix parameter is null then original description is the look up key. The key value is used to look up the description from a resource bundle.

Parameters:
schemaClass - the fully qualified class name of the schema
prefix - the optional prefix argument
Returns:
result the string if found in�the resource bundle or null
See Also:
canonize( String schemaClass, Locale locale, String prefix )

canonize

public String canonize(String schemaClass,
                       Locale locale,
                       String prefix)
This is method will attempt to convert the description attribute into a localised value string from a message resource bundle. If the prefix parameter is not null then the description attribute is prepended with a full stop "." to the original description string to make a new look up key. Otherwise if the prefix parameter is null then original description is the look up key. The key value is used to look up the description from a resource bundle.

Parameters:
schemaClass - the fully qualified class name of the schema
locale - the locale
prefix - the optional prefix argument
Returns:
result the string if found in�the resource bundle or null
See Also:
getDescription()

canonize

public String canonize(RequestContext request,
                       String schemaClass,
                       String prefix)
This is method will attempt to convert the description attribute into a localised value string from a message resource bundle. If the prefix parameter is not null then the description attribute is prepended with a full stop "." to the original description string to make a new look up key. Otherwise if the prefix parameter is null then original description is the look up key. The key value is used to look up the description from a resource bundle.

Parameters:
schemaClass - the fully qualified class name of the schema
request - the request context containing locale and dbcontext
prefix - the optional prefix argument
Returns:
result the string if found in�the resource bundle or null
See Also:
Messages.getString(String schemaClass, Locale l, String stringCode, Object[] args), canonize( String schemaClass, String prefix ), canonize( String schemaClass, Locale locale, String prefix )

toString

public String toString()
Human readable string for debugging

Overrides:
toString in class ValidValue
Returns:
java.lang.String

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.