atg.droplet
Class NumberTagConverter

java.lang.Object
  extended by atg.droplet.NumberTagConverter
All Implemented Interfaces:
TagConverter

public class NumberTagConverter
extends java.lang.Object
implements TagConverter

Performs conversion to and from Number objects in jhtml tags.


Field Summary
static java.lang.String CLASS_VERSION
           
 
Constructor Summary
NumberTagConverter()
           
 
Method Summary
 java.lang.String convertObjectToString(DynamoHttpServletRequest pReq, java.lang.Object pValue, java.util.Properties pAttributes)
          Coverts a Number to a String using a number formatter pattern.
 java.lang.Object convertStringToObject(DynamoHttpServletRequest pReq, java.lang.String pValue, java.util.Properties pAttributes)
          Coverts a String which represents a number to a Number using a NumberFormatter.
 java.lang.String getName()
          Returns the unique name for the TagConverter.
 TagAttributeDescriptor[] getTagAttributeDescriptors()
          Returns the list of TagAttributeDescriptors which are used by this converter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

NumberTagConverter

public NumberTagConverter()
Method Detail

getTagAttributeDescriptors

public TagAttributeDescriptor[] getTagAttributeDescriptors()
Description copied from interface: TagConverter
Returns the list of TagAttributeDescriptors which are used by this converter. Each TagAttributeDescriptor describes an attribute which can be used by this TagConverter. Attributes can be optional and they can also be automatic. An automatic attribute implies the use of this converter if that attribute appears in the tag (e.g. date=".." implies the use of the DateTagConverter).

Specified by:
getTagAttributeDescriptors in interface TagConverter

getName

public java.lang.String getName()
Description copied from interface: TagConverter
Returns the unique name for the TagConverter. This name can be used by the TagConverterManager to get a handle to this converter. When you specify the use of a TagConverter using the converter attribute in a tag, you use this name to refer to the TagConverter. TagConverter names are case insensitive (as is the convention in HTML).

Specified by:
getName in interface TagConverter

convertStringToObject

public java.lang.Object convertStringToObject(DynamoHttpServletRequest pReq,
                                              java.lang.String pValue,
                                              java.util.Properties pAttributes)
                                       throws TagConversionException
Coverts a String which represents a number to a Number using a NumberFormatter.

Specified by:
convertStringToObject in interface TagConverter
Parameters:
pAttributes - contains a number entry which is used to specify the number format string. An optional locale attribute can be used to specify the locale to use to define the number formatter.
pReq - the request object for this conversion. This object can be null if the conversion is not performed in the context of a request.
pValue - The original String value to be converted.
Returns:
the converted object value.
Throws:
TagConversionException - if the conversion failed.

convertObjectToString

public java.lang.String convertObjectToString(DynamoHttpServletRequest pReq,
                                              java.lang.Object pValue,
                                              java.util.Properties pAttributes)
                                       throws TagConversionException
Coverts a Number to a String using a number formatter pattern.

Specified by:
convertObjectToString in interface TagConverter
Parameters:
pReq - 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 String
pAttributes - the set of attributes supplied in this tag declaration.
Returns:
the converted object value.
Throws:
TagConversionException