Top Description Inners Fields Constructors Methods
javax.faces.convert

pack-priv Class MessageFactory

extends Object
Class Inheritance
Imports
javax.el.ValueExpression, javax.faces.FactoryFinder, javax.faces.application.Application, .ApplicationFactory, .FacesMessage, javax.faces.component.UIComponent, javax.faces.context.FacesContext, javax.faces.el.ValueBinding, java.text.MessageFormat, java.util.Locale, .MissingResourceException, .ResourceBundle

supported filters: package and protection.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
MessageFactory.BindingFacesMessage

This class overrides FacesMessage to provide the evaluation of binding expressions in addition to Strings.

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected static Application
protected static ClassLoader
getCurrentLoader(Class<T> fallbackClass)

pack-priv static Object

Returns:

the label, if any, of the component
getLabel
(FacesContext
- the FacesContext for the current request
context
,
UIComponent
- the component of interest
component
)

Returns the label property from the specified component.

pack-priv static FacesMessage
getMessage(String messageId, FacesMessage.Severity
set a custom severity
severity
,
Object... params)

pack-priv static FacesMessage
getMessage(Locale locale, String messageId, FacesMessage.Severity
set a custom severity
severity
,
Object... params)

pack-priv static FacesMessage
getMessage(FacesContext context, String messageId, FacesMessage.Severity
set a custom severity
severity
,
Object... params)

pack-priv static FacesMessage

Returns:

a localized FacesMessage with the severity of FacesMessage.SEVERITY_ERROR
getMessage
(String
- the key of the message in the resource bundle
messageId
,
Object...
- substittion parameters
params
)

This version of getMessage() is used for localizing implementation specific messages.

pack-priv static FacesMessage

Returns:

a localized FacesMessage with the severity of FacesMessage.SEVERITY_ERROR
getMessage
(Locale
- the target Locale
locale
,
String
- the key of the message in the resource bundle
messageId
,
Object...
- substittion parameters
params
)

Creates and returns a FacesMessage for the specified Locale.

pack-priv static FacesMessage

Returns:

a localized FacesMessage with the severity of FacesMessage.SEVERITY_ERROR
getMessage
(FacesContext
- the FacesContext for the current request
context
,
String
- the key of the message in the resource bundle
messageId
,
Object...
- substittion parameters
params
)

Creates and returns a FacesMessage for the specified Locale.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MOJARRA_RESOURCE_BASENAMEback to summary
private static final String MOJARRA_RESOURCE_BASENAME

Constructor Detail

MessageFactoryback to summary
private MessageFactory()

Method Detail

getApplicationback to summary
protected static Application getApplication()
getCurrentLoaderback to summary
protected static ClassLoader getCurrentLoader(Class<T> fallbackClass)
getLabelback to summary
pack-priv static Object getLabel(FacesContext context, UIComponent component)

Returns the label property from the specified component.

Parameters
context:FacesContext

- the FacesContext for the current request

component:UIComponent

- the component of interest

Returns:Object

the label, if any, of the component

getMessageback to summary
pack-priv static FacesMessage getMessage(String messageId, FacesMessage.Severity severity, Object... params)
Parameters
severity:FacesMessage.Severity

set a custom severity

See Also
getMessage(String, Object...)
getMessageback to summary
pack-priv static FacesMessage getMessage(Locale locale, String messageId, FacesMessage.Severity severity, Object... params)
Parameters
severity:FacesMessage.Severity

set a custom severity

See Also
getMessage(Locale, String, Object...)
getMessageback to summary
pack-priv static FacesMessage getMessage(FacesContext context, String messageId, FacesMessage.Severity severity, Object... params)
Parameters
severity:FacesMessage.Severity

set a custom severity

See Also
getMessage(FacesContext, String, Object...)
getMessageback to summary
pack-priv static FacesMessage getMessage(String messageId, Object... params)

This version of getMessage() is used for localizing implementation specific messages.

Parameters
messageId:String

- the key of the message in the resource bundle

params:Object[]

- substittion parameters

Returns:FacesMessage

a localized FacesMessage with the severity of FacesMessage.SEVERITY_ERROR

getMessageback to summary
pack-priv static FacesMessage getMessage(Locale locale, String messageId, Object... params)

Creates and returns a FacesMessage for the specified Locale.

Parameters
locale:Locale

- the target Locale

messageId:String

- the key of the message in the resource bundle

params:Object[]

- substittion parameters

Returns:FacesMessage

a localized FacesMessage with the severity of FacesMessage.SEVERITY_ERROR

getMessageback to summary
pack-priv static FacesMessage getMessage(FacesContext context, String messageId, Object... params)

Creates and returns a FacesMessage for the specified Locale.

Parameters
context:FacesContext

- the FacesContext for the current request

messageId:String

- the key of the message in the resource bundle

params:Object[]

- substittion parameters

Returns:FacesMessage

a localized FacesMessage with the severity of FacesMessage.SEVERITY_ERROR

javax.faces.convert back to summary

pack-priv Class MessageFactory.BindingFacesMessage

extends FacesMessage
Class Inheritance

This class overrides FacesMessage to provide the evaluation of binding expressions in addition to Strings. It is often the case, that a binding expression may reference a localized property value that would be used as a substitution parameter in the message. For example: #{bundle.userLabel} "bundle" may not be available until the page is rendered. The "late" binding evaluation in getSummary and getDetail allow the expression to be evaluated when that property is available.

Field Summary

Modifier and TypeField and Description
private Locale
private Object[]
private Object[]
Inherited from javax.faces.application.FacesMessage:
FACES_MESSAGESSEVERITY_ERRORSEVERITY_FATALSEVERITY_INFOSEVERITY_WARNVALUESVALUES_MAP

Constructor Summary

AccessConstructor and Description
pack-priv
BindingFacesMessage(Locale locale, String messageFormat, String detailMessageFormat, Object[] parameters)

Method Summary

Modifier and TypeMethod and Description
public String
getDetail()

Overrides javax.faces.application.FacesMessage.getDetail.

Return the localized detail text.

private String
getFormattedString(String msgtext, Object[] params)

public String
getSummary()

Overrides javax.faces.application.FacesMessage.getSummary.

Return the localized summary text.

private void
Inherited from javax.faces.application.FacesMessage:
getSeverityisRenderedrenderedsetDetailsetSeveritysetSummary

Field Detail

localeback to summary
private Locale locale
parametersback to summary
private Object[] parameters
resolvedParametersback to summary
private Object[] resolvedParameters

Constructor Detail

BindingFacesMessageback to summary
pack-priv BindingFacesMessage(Locale locale, String messageFormat, String detailMessageFormat, Object[] parameters)

Method Detail

getDetailback to summary
public String getDetail()

Overrides javax.faces.application.FacesMessage.getDetail.

Doc from javax.faces.application.FacesMessage.getDetail.

Return the localized detail text. If no localized detail text has been defined for this message, return the localized summary text instead.

Returns:String

the localized detail text.

getFormattedStringback to summary
private String getFormattedString(String msgtext, Object[] params)
getSummaryback to summary
public String getSummary()

Overrides javax.faces.application.FacesMessage.getSummary.

Doc from javax.faces.application.FacesMessage.getSummary.

Return the localized summary text.

Returns:String

the localized summary text.

resolveBindingsback to summary
private void resolveBindings()