Interface MessageFactory

  • All Known Implementing Classes:
    ResourceBundleMessageFactory

    public interface MessageFactory
    A MessageFactory implementation is used to generate localized error messages for record and field level errors.
    Since:
    1.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getFieldErrorMessage​(java.lang.String recordName, java.lang.String fieldName, java.lang.String rule)
      Returns a field level error message.
      java.lang.String getFieldLabel​(java.lang.String recordName, java.lang.String fieldName)
      Returns the localized label for a field.
      java.lang.String getRecordErrorMessage​(java.lang.String recordName, java.lang.String rule)
      Returns a record level error message.
      java.lang.String getRecordLabel​(java.lang.String recordName)
      Returns the localized label for a record.
    • Method Detail

      • getRecordLabel

        java.lang.String getRecordLabel​(java.lang.String recordName)
        Returns the localized label for a record.
        Parameters:
        recordName - the name of the record
        Returns:
        the record label, or null if no label was found
      • getFieldLabel

        java.lang.String getFieldLabel​(java.lang.String recordName,
                                       java.lang.String fieldName)
        Returns the localized label for a field.
        Parameters:
        recordName - the name of the record the field belongs to
        fieldName - the name of the field
        Returns:
        the field label, or null if no label was found
      • getFieldErrorMessage

        java.lang.String getFieldErrorMessage​(java.lang.String recordName,
                                              java.lang.String fieldName,
                                              java.lang.String rule)
        Returns a field level error message.
        Parameters:
        recordName - the name of the record
        fieldName - the name of the field
        rule - the name of the validation rule
        Returns:
        the error message, or null if no message was configured
      • getRecordErrorMessage

        java.lang.String getRecordErrorMessage​(java.lang.String recordName,
                                               java.lang.String rule)
        Returns a record level error message.
        Parameters:
        recordName - the name of the record
        rule - the name of the validation rule
        Returns:
        the error message, or null if no message was configured