B Message Keys for Converter and Validator Messages

This appendix lists all the message keys and message setter methods for ADF Faces converters and validators.

This chapter includes the following sections:

B.1 Introduction to ADF Faces Default Messages

The FacesMessage class supports both summary and detailed messages. The convention is that:

  • The summary message is defined for the main key. The key value is of the form classname.MSG_KEY.

  • The detailed message is of the form classname.MSG_KEY_detail.

In summary, to override a detailed message you can either use the setter method on the appropriate class or enter a replacement message in a resource bundle using the required message key.

Placeholders are used in detail messages to provide relevant details such as the value the user entered and the label of the component for which this is a message. The general order of placeholder identifiers is:

  • component label

  • input value (if present)

  • minimum value (if present)

  • maximum value (if present)

  • pattern (if present)

B.2 Message Keys and Setter Methods

The following information is given for each of the ADF Faces converter and validators:

  • The set method you can use to override the message.

  • The message key you can use to identify your own version of the message in a resource bundle.

  • How placeholders can be used in the message to include details such as the input values and patterns.

B.3 Converter and Validator Message Keys and Setter Methods

This section gives the reference details for all ADF Faces converter and validator detail messages.

B.3.1 af:convertColor

Converts strings representing color values to and from java.awt.Color objects. The set of patterns used for conversion can be overriden.

Convert color: Input value cannot be converted to a color based on the patterns set

Set method:

setMessageDetailConvertBoth(java.lang.String convertBothMessageDetail)

Message key:

org.apache.myfaces.trinidad.convert.ColorConverter.CONVERT_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} A date-time example, based on the dateStyle and timeStyle set in the converter

B.3.2 af:convertDateTime

Converts a string to and from java.util.Date and the converse based on the pattern and style set.

Convert date and time: Date-time value that cannot be converted to Date object when type is set to both

Set method:

setMessageDetailConvertBoth(java.lang.String convertBothMessageDetail)

Message key:

org.apache.myfaces.trinidad.convert.DateTimeConverter.CONVERT_BOTH_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} Example of the format the converter is expecting

Convert date: Input value cannot be converted to a Date when the pattern or secondary pattern is set or when type is set to date

Set method:

setMessageDetailConvertDate(java.lang.String convertDateMessageDetail)

Message key:

org.apache.myfaces.trinidad.convert.DateTimeConverter.CONVERT_DATE_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} Example of the format the converter is expecting

Convert date: Input value cannot be converted to a Date when the pattern or secondary pattern is set or when type is set to date

Set method:

setMessageDetailConvertTime(java.lang.String convertTimeMessageDetail)

Message key:

org.apache.myfaces.trinidad.convert.DateTimeConverter.CONVERT_TIME_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} Example of the format the converter is expecting

B.3.3 af:convertNumber

Provides an extension of the standard JSF javax.faces.convert.NumberConverter class. The converter provides all the standard functionality of the default NumberConverter and is strict while converting to an object.

Convert number: Input value cannot be converted to a Number, based on the pattern set

Set method:

setMessageDetailConvertPattern(java.lang.String convertPatternMessageDetail)

Message key:

org.apache.myfaces.trinidad.convert.NumberConverter.CONVERT_PATTERN_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The specified conversion pattern

Convert number: Input value cannot be converted to a Number when type is set to number and pattern is null or not set

Set method:

setMessageDetailConvertNumber(java.lang.String convertNumberMessageDetail)

Message key:

org.apache.myfaces.trinidad.convert.NumberConverter.CONVERT_NUMBER_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user

Convert number: Input value cannot be converted to a Number when type is set to currency and pattern is null or not set

Set method:

setMessageDetailConvertCurrency(java.lang.String convertCurrencyMessageDetail)

Message key:

org.apache.myfaces.trinidad.convert.NumberConverter.CONVERT_CURRENCY_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user

Convert number: Input value cannot be converted to a Number when type is set to percent and pattern is null or not set

Set method:

setMessageDetailConvertPercent(java.lang.String convertPercentMessageDetail)

Message key:

org.apache.myfaces.trinidad.convert.NumberConverter.CONVERT_PERCENT_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user

B.3.4 af:validateByteLength

Validates the byte length of strings when encoded.

Validate byte length: The input value exceeds the maximum byte length

Set method:

setMessageDetailMaximum(java.lang.String maximumMessageDetail)

Message key:

org.apache.myfaces.trinidad.validator.ByteLengthValidator.MAXIMUM_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} Maximum length

B.3.5 af:validateDateRestriction

Validates that the date is valid with some given restrictions.

Validate date restriction - Invalid Date: The input value is invalid when invalidDate is set

Set method:

setMessageDetailInvalidDays(java.lang.String invalidDays)

Message key:

org.apache.myfaces.trinidad.validator.DateRestrictionValidator.WEEKDAY_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The invalid date

Validate date restriction - Invalid day of the week: The input value is invalid when invalidDaysOfWeek is set

Set method:

setMessageDetailInvalidDaysOfWeek(java.lang.String invalidDaysOfWeek)

Message key:

org.apache.myfaces.trinidad.validator.DateRestrictionValidator.DAY_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The invalid month

Validate date restriction - Invalid month: The input value is invalid when invalidMonths is set

Set method:

setMessageDetailInvalidMonths(java.lang.String invalidMonths)

Message key:

org.apache.myfaces.trinidad.validator.DateRestrictionValidator.MONTH_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The invalid weekday

B.3.6 af:validateDateTimeRange

Validates that the date entered is within a given range.

Validate date-time range: The input value exceeds the maximum value set

Set method:

setMessageDetailMaximum(java.lang.String maximumMessageDetail)

Message key:

org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.MAXIMUM_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The maximum allowed date

Validate date-time range: The input value is less than the minimum value set

Set method:

setMessageDetailMinimum(java.lang.String minimumMessageDetail)

Message key:

org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.MINIMUM_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The minimum allowed date

Validate date-time range: The input value is not within the range, when minimum and maximum are set

Set method:

setMessageDetailNotInRange(java.lang.String notInRangeMessageDetail)

Message key:

org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.NOT_IN_RANGE_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The minimum allowed date
{3} The maximum allowed date

B.3.7 af:validateDoubleRange

Validates that the value entered is within a given range.

Validate double range: The input value exceeds the maximum value set

Set method:

setMessageDetailMaximum(java.lang.String maximumMessageDetail)

Message key:

org.apache.myfaces.trinidad.validator.DoubleRangeValidator.MAXIMUM_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The maximum allowed value

Validate double range: The input value is less than the minimum value set

Set method:

setMessageDetailMinimum(java.lang.String minimumMessageDetail)

Message key:

org.apache.myfaces.trinidad.validator.DoubleRangeValidator.MINIMUM_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The minimum allowed value

Validate double range: The input value is not within the range, when minimum and maximum are set

Set method:

setMessageDetailNotInRange(java.lang.String notInRangeMessageDetail)

Message key:

org.apache.myfaces.trinidad.validator.DoubleRangeValidator.NOT_IN_RANGE_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The minimum allowed value
{3} The maximum allowed value

B.3.8 af:validateLength

Validates that the value entered is within a given range.

Validate length: The input value exceeds the maximum value set

Set method:

setMessageDetailMaximum(java.lang.String maximumMessageDetail)

Message key:

org.apache.myfaces.trinidad.validator.LengthValidator.MAXIMUM_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The maximum allowed length

Validate length: The input value is less than the minimum value set

Set method:

setMessageDetailMinimum(java.lang.String minimumMessageDetail)

Message key:

org.apache.myfaces.trinidad.validator.LengthValidator.MINIMUM_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The minimum allowed length

Validate length: The input value is not within the range, when minimum and maximum are set

Set method:

setMessageDetailNotInRange(java.lang.String notInRangeMessageDetail)

Message key:

org.apache.myfaces.trinidad.validator.LengthValidator.NOT_IN_RANGE_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The minimum allowed length
{3} The maximum allowed length

B.3.9 af:validateRegExp

Validates an expression using Java regular expression syntax.

Validate regular expression: The input value does not match the specified pattern

Set method:

setMessageDetailNoMatch(java.lang.String noMatchMessageDetail)

Message key:

org.apache.myfaces.trinidad.validator.RegExpValidator.NO_MATCH_detail

Placeholders:


{0} The label that identifies the component
{1} Value entered by the user
{2} The expected pattern