public String getMessage()

in core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/AbstractValidationErrorMessageResolver.java [62:126]


    public String getMessage(String key, Locale locale)
    {
        if (key == null || key.equals(""))
        {
            return null;
        }

        if(key.contains(" "))
        {
            if(key.endsWith("_detail"))
            {
                key = key.substring(0, key.length() - 7);
            }
            return key;
        }

        String customMessage = null;

        try
        {
            customMessage = tryToFindCustomMessage(key, locale);
        }
        catch (Exception e)
        {
            //do nothing
        }

        if (customMessage != null)
        {
            return customMessage;
        }

        /*
         * try to use the convention for the message bundle
         */
        try
        {
            customMessage = tryToUseMessageBundleConvention(key, locale);
        }
        catch (Exception e)
        {
            //do nothing
        }

        if (customMessage != null)
        {
            return customMessage;
        }

        /*
         * no message bundle or message found (with the convention)?
         */

        //try to load custom messages
        try
        {
            customMessage = tryToFindCustomMessageInCustomResourceBundle(key, locale);
        }
        catch (Exception e)
        {
            //do nothing - it was just a try
        }

        return determineMessage(key, locale, customMessage);
    }