Top Description Inners Fields Constructors Methods
com.sun.faces.ext.validator

pack-priv Class MojarraMessageFactory

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, java.util.logging.Level, .Logger

supported filters: package and protection.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
MojarraMessageFactory.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 Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected static Application
protected static ClassLoader
getCurrentLoader(Object fallbackClass)

protected 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.

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

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

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

protected 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.

protected 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.

protected 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

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

MojarraMessageFactoryback to summary
private MojarraMessageFactory()

Method Detail

getApplicationback to summary
protected static Application getApplication()
getCurrentLoaderback to summary
protected static ClassLoader getCurrentLoader(Object fallbackClass)
getLabelback to summary
protected 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
protected static FacesMessage getMessage(String messageId, FacesMessage.Severity severity, Object... params)
Parameters
messageId:String

set a custom severity

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

set a custom severity

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

set a custom severity

See Also
getMessage(FacesContext, String, Object...)
getMessageback to summary
protected 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
protected 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
protected 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

com.sun.faces.ext.validator back to summary

pack-priv Class MojarraMessageFactory.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[]
private static final long
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
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.faces.application.FacesMessage.serialVersionUID.

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.

Annotations
@Override
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.

Annotations
@Override
resolveBindingsback to summary
private void resolveBindings()