Class ValidationBundle

java.lang.Object
com.jk.core.validation.builtin.ValidationBundle

public class ValidationBundle extends Object
This class is a utility class for retrieving localized error messages using a class-based approach.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Details

    • ValidationBundle

      public ValidationBundle()
  • Method Details

    • getMessage

      public static String getMessage(Class class1, String string, int port)
      This method retrieves a localized error message using a specified message key and port value.
      Parameters:
      class1 - Specifies the class from which the message is being retrieved.
      string - Specifies the message key.
      port - Specifies the port value.
      Returns:
      the localized error message.
    • getMessage

      public static String getMessage(Class class1, String string, Object[] objects)
      This method retrieves a localized error message using a specified message key and an array of objects.
      Parameters:
      class1 - Specifies the class from which the message is being retrieved.
      string - Specifies the message key.
      objects - Specifies an array of objects used in formatting the message.
      Returns:
      the localized error message.
    • getMessage

      public static String getMessage(Class class1, String string, String compName)
      This method retrieves a localized error message using a specified message key and a component name.
      Parameters:
      class1 - Specifies the class from which the message is being retrieved.
      string - Specifies the message key.
      compName - Specifies the name of the component related to the error message.
      Returns:
      the localized error message.
    • getMessage

      public static String getMessage(Class class1, String string, String compName, String model)
      This method retrieves a localized error message using a specified message key, a component name, and a model.
      Parameters:
      class1 - Specifies the class from which the message is being retrieved.
      string - Specifies the message key.
      compName - Specifies the name of the component related to the error message.
      model - Specifies the model or value related to the error message.
      Returns:
      the localized error message.
    • getMessage

      public static String getMessage(Class class1, String string, String compName, String curr, String charsetName)
      This method retrieves a localized error message using a specified message key, a component name, a current value, and a charset name.
      Parameters:
      class1 - Specifies the class from which the message is being retrieved.
      string - Specifies the message key.
      compName - Specifies the name of the component related to the error message.
      curr - Specifies the current value or state related to the error message.
      charsetName - Specifies the charset name related to the error message.
      Returns:
      the localized error message.