Class IntegerConverter

All Implemented Interfaces:
Converter<IntegerConversion,Integer>, Policy<IntegerConversion>

public class IntegerConverter extends AbstractConverterSupport<IntegerConversion,Integer>
  • Constructor Details

    • IntegerConverter

      public IntegerConverter()
  • Method Details

    • format

      public String format(Integer unformattedValue) throws Exception
      Description copied from interface: Converter
      Returns single field value formatted for display in a form field. Only applies single value recipients. Not called if the unformatted value is null, unless Converter.getProcessNoValue() returns true..
      Throws:
      Exception
    • getRecipientClass

      public Class<Integer> getRecipientClass()
      Description copied from interface: Converter
      Returns type of recipient fields that can receive converted form value.
    • getMessageType

      public Required.MessageType getMessageType()
      Description copied from interface: Converter
      Returns whether to write any error message to action errors, field errors, or action messages.
    • getMessage

      public String getMessage()
      Description copied from interface: Converter
      Returns message set by annotation. Used if Converter.getMessageKey() is empty string or it fails to find a message.
    • getMessageKey

      public String getMessageKey()
      Description copied from interface: Converter
      Returns message key set by annotation, which is used to retrieve message from Action's TextProvider if it's not empty string.
    • getRecipientFieldName

      public String getRecipientFieldName()
      Description copied from interface: Converter
      Returns name of field to receive converted form value, which can be empty string to use default.
    • convert

      public ConversionResult<Integer> convert(String formValue, Class<? extends Integer> recipientClass) throws Exception
      Description copied from interface: Converter
      Returns result of conversion of form field. This is not called if the form value is empty string or null, unless Converter.getProcessNoValue() returns true.
      Throws:
      Exception
    • getProcessNoValue

      public boolean getProcessNoValue()
      Description copied from interface: Converter
      Returns whether Converter.convert(java.lang.String, java.lang.Class<? extends T>) converts empty string value, and Converter.format(T) formats null value.