Package org.keycloak.theme.beans
Class MessagesPerFieldBean
java.lang.Object
org.keycloak.theme.beans.MessagesPerFieldBean
Bean used to hold form messages per field. Stored under
messagesPerField
key in Freemarker context.- Author:
- Vlastimil Elias (velias at redhat dot com)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessage
(String field, String messageText, MessageType messageType) boolean
Check if message for given field existsboolean
existsError
(String... fields) Check if exists error message for given fieldsGet message for given field.getFirstError
(String... fields) Get first error message for given fieldsprintIfExists
(String fieldName, String text) Print text if message for given field exists.
-
Constructor Details
-
MessagesPerFieldBean
public MessagesPerFieldBean()
-
-
Method Details
-
addMessage
-
exists
Check if message for given field exists- Parameters:
field
-- Returns:
-
existsError
Check if exists error message for given fields- Parameters:
fields
-- Returns:
-
getFirstError
Get first error message for given fields- Parameters:
fields
-- Returns:
- message text or empty string
-
get
Get message for given field.- Parameters:
fieldName
-- Returns:
- message text or empty string
-
printIfExists
Print text if message for given field exists. Useful eg. to add css styles for fields with message.- Parameters:
fieldName
- to check fortext
- to print- Returns:
- text if message exists for given field, else empty string
-