com.bowstreet.methods
Class BaseInputFieldFormatter

java.lang.Object
  extended by com.bowstreet.methods.BaseInputFieldFormatter
All Implemented Interfaces:
IInputFieldFormatter

public class BaseInputFieldFormatter
extends java.lang.Object
implements IInputFieldFormatter


Constructor Summary
BaseInputFieldFormatter()
           
 
Method Summary
 java.lang.String format(java.lang.String value, java.lang.String format)
          Format a value for a html display item.
 java.lang.String getErrorMessage()
          Get the message for the failed validation/translation.
 java.util.List getFormatExpressionList()
          Get a list of available format expressions.
 java.util.List getTranslateExpressionList()
          Get a list of available translate expressions.
 boolean getTranslateSuccessFlag()
          Get the translate success flag.
 java.util.List getValidateExpressionList()
          Get a list of available validate expressions.
 WebAppAccess getWebAppAccess()
          Get the webAppAccess object.
 void setErrorMessage(java.lang.String message)
          Set a message that will be stored in an error variable when the validation/translation fails.
 void setTranslateSuccessFlag(boolean succeeded)
          Set the translate success flag.
 void setWebAppAccess(WebAppAccess webAppAccess)
          Set WebAppAccess object.
 java.lang.String translate(java.lang.String value, java.lang.String format)
          Translate a value from a html display.
 boolean validate(java.lang.String value, java.lang.String expression)
          Validate a value from a html input.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseInputFieldFormatter

public BaseInputFieldFormatter()
Method Detail

format

public java.lang.String format(java.lang.String value,
                               java.lang.String format)
Format a value for a html display item.

Specified by:
format in interface IInputFieldFormatter
Parameters:
value - The value that will be formatted.
format - The format expression that can be used for formatting.
Returns:
The formatted string value.

getErrorMessage

public final java.lang.String getErrorMessage()
Get the message for the failed validation/translation. This method is used by the system to process the error messages.

Specified by:
getErrorMessage in interface IInputFieldFormatter
Returns:
The message for the failed validation/translation.

getFormatExpressionList

public java.util.List getFormatExpressionList()
Get a list of available format expressions. sub class needs to implement this method to return its own availabe ones.

Specified by:
getFormatExpressionList in interface IInputFieldFormatter
Returns:
The list of available format expressions.

getTranslateExpressionList

public java.util.List getTranslateExpressionList()
Get a list of available translate expressions. sub class needs to implement this method to return its own availabe ones.

Specified by:
getTranslateExpressionList in interface IInputFieldFormatter
Returns:
The list of available translate expressions.

getTranslateSuccessFlag

public final boolean getTranslateSuccessFlag()
Get the translate success flag. This method is used by the system to process the error handling.

Specified by:
getTranslateSuccessFlag in interface IInputFieldFormatter
Returns:
boolean The translate success flag.

getValidateExpressionList

public java.util.List getValidateExpressionList()
Get a list of available validate expressions. sub class needs to implement this method to return its own availabe ones.

Specified by:
getValidateExpressionList in interface IInputFieldFormatter
Returns:
The list of available validate expressions.

getWebAppAccess

public final WebAppAccess getWebAppAccess()
Get the webAppAccess object. Users can use this method to access the runtime model information.

Specified by:
getWebAppAccess in interface IInputFieldFormatter
Returns:
The webAppAccess object.

setErrorMessage

public final void setErrorMessage(java.lang.String message)
Set a message that will be stored in an error variable when the validation/translation fails. Users can add an error message for a failed validation or translation process with this method.

Specified by:
setErrorMessage in interface IInputFieldFormatter
Parameters:
message - The message for the failed validation/translation.

setTranslateSuccessFlag

public final void setTranslateSuccessFlag(boolean succeeded)
Set the translate success flag. This method will be used by the translate() method to store the translate result.

Specified by:
setTranslateSuccessFlag in interface IInputFieldFormatter
Parameters:
succeeded - The flag for the translation. It should be true when the it succeeds, and false when it fails.

setWebAppAccess

public final void setWebAppAccess(WebAppAccess webAppAccess)
Set WebAppAccess object. This method is used by the system.

Specified by:
setWebAppAccess in interface IInputFieldFormatter
Parameters:
webAppAccess - The WebAppAccess object.

translate

public java.lang.String translate(java.lang.String value,
                                  java.lang.String format)
Translate a value from a html display.

Specified by:
translate in interface IInputFieldFormatter
Parameters:
value - The value that will be translated.
format - The format expression that can be used for the translation.
Returns:
The translated string value.
See Also:
FieldFormatterTranslationError

validate

public boolean validate(java.lang.String value,
                        java.lang.String expression)
Validate a value from a html input.

Specified by:
validate in interface IInputFieldFormatter
Parameters:
value - The value that will be validated.
expression - The expression that can be used for valiation.
Returns:
The boolean value of the validation result.


Copyright © 2009 IBM. All Rights Reserved.