Interface NumericTranslatorSupport

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T extends >
      <T> type)
      Returns the default message key for parse failures for the indicated type.
      <T extends >
      T
      <T> type,  clientValue)
      Parses a client-submitted value in a localized manner.
      <T extends >
      void
      <T> type, Element element,  message)
      Adds client-side format validation for the field, appropriate to the indicated type.
      <T extends >
      <T> type, T value)
      Converts a server-side value to a client-side string.
    • Method Detail

      • parseClient

        <T extends > T <T> type,
                                          clientValue)
                                  throws 
        Parses a client-submitted value in a localized manner.
        Type Parameters:
        T -
        Parameters:
        type - desired type of value
        clientValue - value from client; this will be trimmed of leading/trailing whitespace
        Returns:
        the parsed value
        Throws:
        See Also:
        Translator.parseClient(org.apache.tapestry5.Field, String, String)
      • toClient

        <T extends >  <T> type,
                                           T value)
        Converts a server-side value to a client-side string. Integer types are formatted simply; decimal types may be formatted using thousands-seperator commas.
        Type Parameters:
        T -
        Parameters:
        type - type of value to convert
        value - current (non-null) value
        Returns:
        value formatted
      • getMessageKey

        <T extends >  <T> type)
        Returns the default message key for parse failures for the indicated type.
        Type Parameters:
        T -
        Parameters:
        type -
        Returns:
        a message key: either "integer-format-exception" or "number-format-exception"
      • setupTranslation

        <T extends > void <T> type,
                                                 Element element,
                                                  message)
        Adds client-side format validation for the field, appropriate to the indicated type.
        Parameters:
        type - value type
        element -
        message - message if the client-side value can't be parsed as a number