org.dasein.attributes.types
Class StringFactory

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

public class StringFactory
extends DataTypeFactory<String>

See Also:
Serialized Form

Nested Class Summary
static class StringFactory.StringAttribute
           
 
Nested classes/interfaces inherited from class org.dasein.attributes.DataTypeFactory
DataTypeFactory.Constraint
 
Field Summary
static String TYPE_NAME
           
 
Constructor Summary
StringFactory()
           
 
Method Summary
 DataTypeFactory.Constraint getConstraint(String... typeInfo)
          Overrides the default method to allow conditional checking.
 Collection<DataTypeFactory.Constraint> getConstraints()
          Implementing classes should override this method to define any governing constraints.
 Translator<String> getDisplayName()
          Provides a multi-lingual display name for this data type.
 DataType<String> getType(boolean ml, boolean mv, boolean req, String... params)
          Provides access to the underlying data type object that governs this data type.
 String getTypeName()
           
 
Methods inherited from class org.dasein.attributes.DataTypeFactory
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
See Also:
Constant Field Values
Constructor Detail

StringFactory

public StringFactory()
Method Detail

getConstraint

public DataTypeFactory.Constraint getConstraint(String... typeInfo)
Overrides the default method to allow conditional checking. Only for non-longtext strings do we allow for a list of choices.

Overrides:
getConstraint in class DataTypeFactory<String>
Parameters:
typeInfo - the string values from previous constraints
Returns:
the next constraint in the list of constraints with the data type modified to reflect the specified type info

getConstraints

public Collection<DataTypeFactory.Constraint> getConstraints()
Description copied from class: DataTypeFactory
Implementing classes should override this method to define any governing constraints. A constraint is simply another data type that will govern values of this type. Imagine, for example, a MediaAttribute data type that had values of a specific media type. For one attribute, "images", only Media objects that are images are allowed. For another attribute, "documents", only documents are allowed. You would thus have a MediaTypeAttribute data type that allowed media types (image, document, etc). That data type, in turn, would be a constraint on your MediaAttribute data type.

Overrides:
getConstraints in class DataTypeFactory<String>
Returns:
a list of constraints on this data type

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<String>
Returns:
the display name for the data type

getTypeName

public String getTypeName()
Specified by:
getTypeName in class DataTypeFactory<String>
Returns:
the name of this data type

getType

public DataType<String> getType(boolean ml,
                                boolean mv,
                                boolean req,
                                String... params)
Description copied from class: DataTypeFactory
Provides access to the underlying data type object that governs this data type. The configurable rules for the data type are provided as parameters.

Specified by:
getType in class DataTypeFactory<String>
Parameters:
ml - is the data type multi-lingual?
mv - is the data type multi-valued?
req - is a value for the data type required?
params - arbitrary parameters with meaning dependent on the underlying type
Returns:
a data type object for the specified type