Top Description Fields Constructors Methods
javax.faces.view.facelets

public abstract Class FaceletContext

extends ELContext
Class Inheritance
Imports
java.io.IOException, java.net.URL, javax.el.ELContext, .ExpressionFactory, .FunctionMapper, .VariableMapper, javax.faces.component.UIComponent, javax.faces.context.FacesContext

Context representative of a single request from a Facelet. This instance is passed to nearly every method call in this API.

Since
2.0

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract String

Returns:

the generated id
generateUniqueId
(String
the string from which to generate the ID.
base
)

Generate a unique ID for the passed String

public abstract Object

Returns:

the value of the named attribute
getAttribute
(String
the name of the attribute to return.
name
)

Return an attribute set by a previous call to setAttribute.

public abstract ExpressionFactory

Returns:

the ExpressionFactory for this Facelet.
getExpressionFactory
()

The ExpressionFactory to use within the Facelet this context is executing upon.

public abstract FacesContext

Returns:

The current FacesContext bound to this "request".
getFacesContext
()

The current FacesContext bound to this "request".

public abstract void
includeFacelet(UIComponent
the UIComponent that will be the parent of any components in the included facelet.
parent
,
String
the path of the resource containing the facelet markup, relative to the current markup
relativePath
)

Include another Facelet defined at some path, relative to the executing context, not the current Facelet (same as include directive in JSP)

public abstract void
includeFacelet(UIComponent
the UIComponent that will be the parent of any components in the included facelet.
parent
,
URL
the absolute path to the resource containing the facelet markup
absolutePath
)

Include another Facelet defined at some path, absolute to this ClassLoader/OS

public abstract void
setAttribute(String
the name of the attribute
name
,
Object
the value of the attribute
value
)

Support method which is backed by the current VariableMapper.

public abstract void
setFunctionMapper(FunctionMapper
the new FunctionMapper
fnMapper
)

Set the FunctionMapper to use in EL evaluation/creation.

public abstract void
setVariableMapper(VariableMapper
the new VariableMapper
varMapper
)

Set the VariableMapper to use in EL evaluation/creation.

Inherited from javax.el.ELContext:
addEvaluationListenerconvertToTypeenterLambdaScopeexitLambdaScopegetContextgetELResolvergetEvaluationListenersgetFunctionMappergetImportHandlergetLambdaArgumentgetLocalegetVariableMapperisLambdaArgumentisPropertyResolvednotifyAfterEvaluationnotifyBeforeEvaluationnotifyPropertyResolvedputContextsetLocalesetPropertyResolvedsetPropertyResolved

Field Detail

FACELET_CONTEXT_KEYback to summary
public static final String FACELET_CONTEXT_KEY

Constructor Detail

FaceletContextback to summary
public FaceletContext()

Method Detail

generateUniqueIdback to summary
public abstract String generateUniqueId(String base)

Generate a unique ID for the passed String

Parameters
base:String

the string from which to generate the ID.

Returns:String

the generated id

Since
2.0
getAttributeback to summary
public abstract Object getAttribute(String name)

Return an attribute set by a previous call to setAttribute. Support method which is backed by the current VariableMapper

Parameters
name:String

the name of the attribute to return.

Returns:Object

the value of the named attribute

Since
2.0
getExpressionFactoryback to summary
public abstract ExpressionFactory getExpressionFactory()

The ExpressionFactory to use within the Facelet this context is executing upon. Must not be null.

Returns:ExpressionFactory

the ExpressionFactory for this Facelet.

Since
2.0
getFacesContextback to summary
public abstract FacesContext getFacesContext()

The current FacesContext bound to this "request". Must not be null.

Returns:FacesContext

The current FacesContext bound to this "request".

Since
2.0
includeFaceletback to summary
public abstract void includeFacelet(UIComponent parent, String relativePath) throws IOException

Include another Facelet defined at some path, relative to the executing context, not the current Facelet (same as include directive in JSP)

Parameters
parent:UIComponent

the UIComponent that will be the parent of any components in the included facelet.

relativePath:String

the path of the resource containing the facelet markup, relative to the current markup

Exceptions
IOException:
if unable to load relativePath
FaceletException:
if unable to parse the markup loaded from relativePath
FacesException:
if unable to create child UIComponent instances
ELException:
if any of the expressions in the markup loaded from relativePath fail
Since
2.0
includeFaceletback to summary
public abstract void includeFacelet(UIComponent parent, URL absolutePath) throws IOException

Include another Facelet defined at some path, absolute to this ClassLoader/OS

Parameters
parent:UIComponent

the UIComponent that will be the parent of any components in the included facelet.

absolutePath:URL

the absolute path to the resource containing the facelet markup

Exceptions
IOException:
if unable to load relativePath
FaceletException:
if unable to parse the markup loaded from relativePath
FacesException:
if unable to create child UIComponent instances
ELException:
if any of the expressions in the markup loaded from relativePath fail
setAttributeback to summary
public abstract void setAttribute(String name, Object value)

Support method which is backed by the current VariableMapper.

Parameters
name:String

the name of the attribute

value:Object

the value of the attribute

Since
2.0
setFunctionMapperback to summary
public abstract void setFunctionMapper(FunctionMapper fnMapper)

Set the FunctionMapper to use in EL evaluation/creation.

Parameters
fnMapper:FunctionMapper

the new FunctionMapper

Since
2.0
setVariableMapperback to summary
public abstract void setVariableMapper(VariableMapper varMapper)

Set the VariableMapper to use in EL evaluation/creation.

Parameters
varMapper:VariableMapper

the new VariableMapper

Since
2.0