org.dasein.attributes.types
Class CurrencyFactory

java.lang.Object
  extended by org.dasein.attributes.DataTypeFactory<Currency>
      extended by org.dasein.attributes.types.CurrencyFactory
All Implemented Interfaces:
Serializable

public class CurrencyFactory
extends DataTypeFactory<Currency>

Represents currency values as Currency instances.

Last modified: $Date: 2009/01/30 23:01:49 $

Version:
$Revision: 1.6 $
Author:
George Reese
See Also:
Serialized Form

Nested Class Summary
static class CurrencyFactory.CurrencyAttribute
           Implementation of rules for currency attributes.
 
Nested classes/interfaces inherited from class org.dasein.attributes.DataTypeFactory
DataTypeFactory.Constraint
 
Field Summary
static String TYPE_NAME
          The type name: 'currency'
 
Constructor Summary
CurrencyFactory()
          Constructs a currency factory instance.
 
Method Summary
 Translator<String> getDisplayName()
          Provides a multi-lingual display name for this data type.
 DataType<Currency> getType(boolean ml, boolean mv, boolean req, String... params)
          Provides a currency data type instance that supports the specified type rules.
 DataType<Currency> getType(String grp, Number idx, boolean ml, boolean mv, boolean req, String... params)
          Provides a currency data type instance that supports the specified type rules.
 String getTypeName()
           
 
Methods inherited from class org.dasein.attributes.DataTypeFactory
getConstraint, getConstraints, getDisplayValue, getDisplayValue, getInstance, getStringValue, getTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NAME

public static final String TYPE_NAME
The type name: 'currency'

See Also:
Constant Field Values
Constructor Detail

CurrencyFactory

public CurrencyFactory()
Constructs a currency factory instance.

Method Detail

getDisplayName

public Translator<String> getDisplayName()
Description copied from class: DataTypeFactory
Provides a multi-lingual display name for this data type.

Specified by:
getDisplayName in class DataTypeFactory<Currency>
Returns:
a display name for the data type

getTypeName

public String getTypeName()
Specified by:
getTypeName in class DataTypeFactory<Currency>
Returns:
the type name: 'currency'

getType

public DataType<Currency> getType(boolean ml,
                                  boolean mv,
                                  boolean req,
                                  String... params)
Provides a currency data type instance that supports the specified type rules. This data type allows for zero or one type parameters. If no type parameter is specified, then the data type will allow any currency value. If one is specified, it is expected to be a single, comma-delimited string in which each element is the code for an allowed currency. The code should return a valid currency when passed to Currency.getInstance(java.lang.String).

Specified by:
getType in class DataTypeFactory<Currency>
Parameters:
ml - is the type multi-lingual?
mv - can this type support multiple values?
req - is a value required for this type?
params - the type parameters
Returns:
a data type object for the specified type

getType

public DataType<Currency> getType(String grp,
                                  Number idx,
                                  boolean ml,
                                  boolean mv,
                                  boolean req,
                                  String... params)
Provides a currency data type instance that supports the specified type rules. This data type allows for zero or one type parameters. If no type parameter is specified, then the data type will allow any currency value. If one is specified, it is expected to be a single, comma-delimited string in which each element is the code for an allowed currency. The code should return a valid currency when passed to Currency.getInstance(java.lang.String).

Specified by:
getType in class DataTypeFactory<Currency>
Parameters:
grp - the group of the data type.
idx - the index of the data type.
ml - is the type multi-lingual?
mv - can this type support multiple values?
req - is a value required for this type?
params - the type parameters
Returns:
a data type object for the specified type


Copyright © 2011 enStratus Networks LLC. All Rights Reserved.