com.ibm.dse.base.types
Interface PropertyDescription

All Known Implementing Classes:
AbstractPropertyDescriptor

public interface PropertyDescription

This interface is implemented by all PropertyDescriptors which descend from the abstract implementation, AbstractPropertyDescriptor.

PropertyDescriptors are responsible for describing the business object which they are associated with. A default PropertyDescriptor is associated with each Type in order to describe default business behaviour for a given Type.


Method Summary
 void applyDefaultDescriptor(PropertyDescription descriptor)
          Forces this PropertyDescriptor to inherit the business rules of the passed descriptor.
 java.lang.Object cloneDescriptee(java.lang.Object value)
          Returns an independent copy of the Object passed.
 java.lang.String formatToString(java.lang.Object value, java.lang.String conversionType)
          Returns the value passed as an Object, formatted as a String using the appropriate conversion type.
 java.lang.String formatToString(java.lang.Object value, java.lang.String conversionType, java.util.Locale locale)
          Returns the value passed as an Object, formatted as a String using the specified conversion type and the specified locale.
 void formatToWriter(java.lang.Object value, java.lang.String conversionType, java.io.Writer writer)
          The value passed as an Object is formatted using the specified conversion type by the writer passed as argument.
 void formatToWriter(java.lang.Object value, java.lang.String conversionType, java.io.Writer writer, java.util.Locale locale)
          The value passed as an Object is formatted using the specified conversion type and the specified locale by the writer passed as argument.
 Conversion getConversion(java.lang.String conversionType)
          Returns the converter which handles the specified conversion type, or null if the conversion type is not supported.
 java.util.Enumeration getConverters()
          Returns an Enumeration of all converters associated with this PropertyDescriptor.
 java.lang.String getDescription()
          Returns the description of business object that this PropertyDescriptor describes.
 java.lang.Class getImplClass()
          Gets the class of the business object descripted by this PropertyDescription
 ElementState getInitialState()
          Returns the initial business state of the business object described by this PropertyDescriptor.
 java.lang.Object getInitialValue()
          Returns the initial value of the business object described by this PropertyDescriptor.
 java.lang.String getName()
          Returns the name of this PropertyDescriptor.
 java.util.Hashtable getParameters()
          Returns a hashtable with all the extra parameters of the PropertyDescription
 Type getType()
          Returns the Type of business object that this PropertyDescriptor describes.
 Validation getValidator()
          Returns the validator responsible for handling validation of the business object described.
 TypedData initializeInstance(TypedData businessObject)
          Initializes the businessObject attributes
 void setConversion(Conversion converter)
          Sets the converter which handles the default conversion type.
 void setConversion(java.lang.String conversionType, Conversion converter)
          Sets the converter which handles the specified conversion type to that passed as argument.
 void setValidator(Validation validator)
          Sets the validator to be employed by this PropertyDescriptor to that passed.
 java.lang.Object unformatFromReader(java.io.Reader reader, java.lang.String conversionType)
          Uses the reader passed to construct an Object of the correct Type using the appropriate conversion type.
 java.lang.Object unformatFromReader(java.io.Reader reader, java.lang.String conversionType, java.util.Locale locale)
          Uses the reader passed to construct an Object of the correct Type using the specified conversion type and the specified locale.
 java.lang.Object unformatFromString(java.lang.String value, java.lang.String conversionType)
          Converts the String passed to an Object using the appropriate conversion Type.
 java.lang.Object unformatFromString(java.lang.String value, java.lang.String conversionType, java.util.Locale locale)
          Converts the String passed to an Object using the specified conversion Type and the specified locale.
 java.lang.Object validate(java.lang.Object toValidate)
          Validates the Object passed by first unformatting and then applying business rules
 java.lang.Object validate(java.lang.Object toValidate, boolean useState)
          Validates the Object passed by first unformatting and then applying business rules.
 

Method Detail

applyDefaultDescriptor

public void applyDefaultDescriptor(PropertyDescription descriptor)
                            throws DSETypeException
Forces this PropertyDescriptor to inherit the business rules of the passed descriptor. Any specific business behaviour defined is retained and will override that of the descriptor passed.
Parameters:
descriptor - PropertyDescription

cloneDescriptee

public java.lang.Object cloneDescriptee(java.lang.Object value)
                                 throws DSETypeException
Returns an independent copy of the Object passed.
Parameters:
value - Object
Returns:
Object

formatToString

public java.lang.String formatToString(java.lang.Object value,
                                       java.lang.String conversionType)
                                throws DSETypeException
Returns the value passed as an Object, formatted as a String using the appropriate conversion type.
Parameters:
value - Object
conversionType - String
Returns:
String
Throws:
DSETypeException - Formatting is unsuccessful.

formatToString

public java.lang.String formatToString(java.lang.Object value,
                                       java.lang.String conversionType,
                                       java.util.Locale locale)
                                throws DSETypeException
Returns the value passed as an Object, formatted as a String using the specified conversion type and the specified locale.
Parameters:
value - Object
conversionType - String
locale - Locale
Returns:
String
Throws:
DSETypeException - Formatting is unsuccessful.

formatToWriter

public void formatToWriter(java.lang.Object value,
                           java.lang.String conversionType,
                           java.io.Writer writer)
                    throws DSETypeException
The value passed as an Object is formatted using the specified conversion type by the writer passed as argument.
Parameters:
value - Object
conversionType - String
writer - Writer
Throws:
DSETypeException - Formatting is unsuccessful.

formatToWriter

public void formatToWriter(java.lang.Object value,
                           java.lang.String conversionType,
                           java.io.Writer writer,
                           java.util.Locale locale)
                    throws DSETypeException
The value passed as an Object is formatted using the specified conversion type and the specified locale by the writer passed as argument.
Parameters:
value - Object
conversionType - String
writer - Writer
locale - Locale
Throws:
DSETypeException - Formatting is unsuccessful.

getConversion

public Conversion getConversion(java.lang.String conversionType)
Returns the converter which handles the specified conversion type, or null if the conversion type is not supported.
Parameters:
conversionType - String
Returns:
Conversion
Throws:
DSETypeException - Conversion type is already supported.

getConverters

public java.util.Enumeration getConverters()
Returns an Enumeration of all converters associated with this PropertyDescriptor.
Returns:
Enumeration

getDescription

public java.lang.String getDescription()
Returns the description of business object that this PropertyDescriptor describes.
Returns:
String

getImplClass

public java.lang.Class getImplClass()
                             throws DSETypeException
Gets the class of the business object descripted by this PropertyDescription
Returns:
java.lang.Class

getInitialState

public ElementState getInitialState()
Returns the initial business state of the business object described by this PropertyDescriptor.
Returns:
ElementState

getInitialValue

public java.lang.Object getInitialValue()
Returns the initial value of the business object described by this PropertyDescriptor.
Returns:
Object

getName

public java.lang.String getName()
Returns the name of this PropertyDescriptor.
Returns:
String

getParameters

public java.util.Hashtable getParameters()
Returns a hashtable with all the extra parameters of the PropertyDescription
Returns:
java.util.Hashtable

getType

public Type getType()
Returns the Type of business object that this PropertyDescriptor describes.
Returns:
Type

getValidator

public Validation getValidator()
Returns the validator responsible for handling validation of the business object described.
Returns:
Validation

initializeInstance

public TypedData initializeInstance(TypedData businessObject)
                             throws DSETypeException
Initializes the businessObject attributes
Parameters:
businessObject - com.ibm.dse.base.TypedData
Returns:
com.ibm.dse.base.TypedData

setConversion

public void setConversion(Conversion converter)
                   throws DSETypeException
Sets the converter which handles the default conversion type.
Parameters:
conversionType - String
converter - Conversion
Throws:
DSETypeException - Conversion type is already supported.

setConversion

public void setConversion(java.lang.String conversionType,
                          Conversion converter)
                   throws DSETypeException
Sets the converter which handles the specified conversion type to that passed as argument.
Parameters:
conversionType - String
converter - Conversion
Throws:
DSETypeException - Conversion type is already supported.

setValidator

public void setValidator(Validation validator)
                  throws DSETypeException
Sets the validator to be employed by this PropertyDescriptor to that passed.
Parameters:
validator - Validation
Throws:
DSETypeException - Validator cannot validate the business object described.

unformatFromReader

public java.lang.Object unformatFromReader(java.io.Reader reader,
                                           java.lang.String conversionType)
                                    throws DSETypeException
Uses the reader passed to construct an Object of the correct Type using the appropriate conversion type.
Parameters:
reader - Reader
conversionType - String
Returns:
Object
Throws:
DSETypeException - Unformatting is unsuccessful.

unformatFromReader

public java.lang.Object unformatFromReader(java.io.Reader reader,
                                           java.lang.String conversionType,
                                           java.util.Locale locale)
                                    throws DSETypeException
Uses the reader passed to construct an Object of the correct Type using the specified conversion type and the specified locale.
Parameters:
reader - Reader
conversionType - String
locale - Locale
Returns:
Object
Throws:
DSETypeException - Unformatting is unsuccessful.

unformatFromString

public java.lang.Object unformatFromString(java.lang.String value,
                                           java.lang.String conversionType)
                                    throws DSETypeException
Converts the String passed to an Object using the appropriate conversion Type.
Parameters:
value - String
conversionType - String
Returns:
Object
Throws:
DSETypeException - Unformatting is unsuccessful.

unformatFromString

public java.lang.Object unformatFromString(java.lang.String value,
                                           java.lang.String conversionType,
                                           java.util.Locale locale)
                                    throws DSETypeException
Converts the String passed to an Object using the specified conversion Type and the specified locale.
Parameters:
value - String
conversionType - String
locale - Locale
Returns:
Object
Throws:
DSETypeException - Unformatting is unsuccessful.

validate

public java.lang.Object validate(java.lang.Object toValidate)
                          throws DSETypeException
Validates the Object passed by first unformatting and then applying business rules

If successful, the Object is returned, otherwise an appropriate exception is thrown.

Parameters:
toValidate - Object
Returns:
Object
Throws:
DSETypeException - Validation is unsuccessful.

validate

public java.lang.Object validate(java.lang.Object toValidate,
                                 boolean useState)
                          throws DSETypeException
Validates the Object passed by first unformatting and then applying business rules. A previous validation based on the initial state attribute is performed if the boolean passed is true.

If successful, the Object is returned, otherwise an appropriate exception is thrown.

Parameters:
toValidate - Object
useState - boolean
Returns:
Object
Throws:
DSETypeException - Validation is unsuccessful.