Package com.jk.core.validation.builtin
Class ValidationBundle
java.lang.Object
com.jk.core.validation.builtin.ValidationBundle
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getMessage
(Class class1, String string, int port) This method retrieves a localized error message using a specified message key and port value.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.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.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.static String
This method retrieves a localized error message using a specified message key, a component name, a current value, and a charset name.
-
Constructor Details
-
ValidationBundle
public ValidationBundle()
-
-
Method Details
-
getMessage
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
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
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
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.
-