Package org.keycloak.theme.beans
Class MessagesPerFieldBean
- java.lang.Object
-
- org.keycloak.theme.beans.MessagesPerFieldBean
-
public class MessagesPerFieldBean extends Object
Bean used to hold form messages per field. Stored undermessagesPerField
key in Freemarker context.- Author:
- Vlastimil Elias (velias at redhat dot com)
-
-
Constructor Summary
Constructors Constructor Description MessagesPerFieldBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessage(String field, String messageText, MessageType messageType)
boolean
exists(String field)
Check if message for given field existsboolean
existsError(String... fields)
Check if exists error message for given fieldsString
get(String fieldName)
Get message for given field.String
getFirstError(String... fields)
Get first error message for given fieldsString
printIfExists(String fieldName, String text)
Print text if message for given field exists.
-
-
-
Method Detail
-
addMessage
public void addMessage(String field, String messageText, MessageType messageType)
-
exists
public boolean exists(String field)
Check if message for given field exists- Parameters:
field
-- Returns:
-
existsError
public boolean existsError(String... fields)
Check if exists error message for given fields- Parameters:
fields
-- Returns:
-
getFirstError
public String getFirstError(String... fields)
Get first error message for given fields- Parameters:
fields
-- Returns:
- message text or empty string
-
get
public String get(String fieldName)
Get message for given field.- Parameters:
fieldName
-- Returns:
- message text or empty string
-
-