|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TagConverter
This interface is implemented by objects that perform String to Object and Object to String conversion using attributes in JHTML tags (valueof, input, etc.). To add your own TagConverter (like the date, number, required, valueishtml converters), you write a class which implements this interface and then register that class with the TagConverterManager.
TagConverters play an important role in both validating and converting values submitted through HTML forms. They can also be used to flexibly format values of various types when converting object values such as dates, numbers, prices, etc. into values displayed to the user. The use of TagConverters can greatly improve the reuse and maintainability of your code and to avoid duplicating logic in each of your Java beans. It is useful to view TagConverters as playing the role of the controllers in the model/view/controller programming paradigm.
For more details on writing a converter @see atg.droplet.TagConverterManager.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Method Summary | |
---|---|
java.lang.String |
convertObjectToString(DynamoHttpServletRequest pRequest,
java.lang.Object pValue,
java.util.Properties pAttributes)
Converts the supplied Object value to a String value. |
java.lang.Object |
convertStringToObject(DynamoHttpServletRequest pRequest,
java.lang.String pValue,
java.util.Properties pAttributes)
Converts the supplied String value to an Object value. |
java.lang.String |
getName()
Returns the unique name for the TagConverter. |
TagAttributeDescriptor[] |
getTagAttributeDescriptors()
Returns the list of TagAttributeDescriptors which are used by this converter. |
Field Detail |
---|
static final java.lang.String CLASS_VERSION
Method Detail |
---|
java.lang.String getName()
TagAttributeDescriptor[] getTagAttributeDescriptors()
java.lang.Object convertStringToObject(DynamoHttpServletRequest pRequest, java.lang.String pValue, java.util.Properties pAttributes) throws TagConversionException
pRequest
- the request object for this conversion. This object
can be null if the conversion is not performed in the context of
a request.pAttributes
- The list of attributes in the tag that is invoking
this converter.pValue
- The original String value to be converted.
TagConversionException
- if the conversion failed.java.lang.String convertObjectToString(DynamoHttpServletRequest pRequest, java.lang.Object pValue, java.util.Properties pAttributes) throws TagConversionException
pRequest
- the request this conversion applies to. You can use
this request to obtain the RequestLocale to localize the conversion
process. This can be null if the conversion is not performed in
the context of a request.pValue
- the Object value to be converted to a StringpAttributes
- the set of attributes supplied in this tag
declaration.
TagConversionException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |