Package org.apache.myfaces.view.facelets
Class TemplateContext
- java.lang.Object
-
- org.apache.myfaces.view.facelets.TemplateContext
-
- Direct Known Subclasses:
TemplateContextImpl
public abstract class TemplateContext extends Object
This class is used to encapsulate the information required to resolve facelets templates. Composite components require to "isolate" the inner template resolution. That means, when a ui:xx tag is used, do not take into account the outer templates defined. The methods here are only used by the current implementation and the intention is not expose it as public api.- Since:
- 2.0.1
- Version:
- $Revision$ $Date$
- Author:
- Leonardo Uribe (latest modification by $Author$)
-
-
Constructor Summary
Constructors Constructor Description TemplateContext()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
addKnownParameters(String knownParameters)
abstract boolean
containsKnownParameter(String key)
abstract boolean
containsParameter(String key)
abstract void
extendClient(AbstractFaceletContext actx, AbstractFacelet owner, TemplateClient client)
abstract TemplateManager
getCompositeComponentClient()
abstract Set<String>
getKnownParameters()
Return a set of the parameters known associated to this template context and/or template.abstract jakarta.el.ValueExpression
getParameter(String key)
Return the param value expression associated to the key passed, preserving the precedence of each template client.abstract Map<String,jakarta.el.ValueExpression>
getParameterMap()
abstract boolean
includeDefinition(FaceletContext ctx, Facelet owner, UIComponent parent, String name)
This method will walk through the TemplateClient stack to resolve and apply the definition for the passed name.abstract boolean
isAllowCacheELExpressions()
abstract boolean
isKnownParametersEmpty()
abstract boolean
isParameterEmpty()
Check if no parameters are set.abstract TemplateManager
popClient(AbstractFaceletContext actx)
Pop the last added pushed TemplateClientabstract TemplateManager
popExtendedClient(AbstractFaceletContext actx)
Pop the last added extended TemplateClientabstract void
pushClient(AbstractFaceletContext actx, AbstractFacelet owner, TemplateClient client)
Push the passed TemplateClient onto the stack for Definition Resolutionabstract void
setAllowCacheELExpressions(boolean cacheELExpressions)
abstract void
setCompositeComponentClient(TemplateManager compositeComponentClient)
Set the composite component TemplateManager instance, used to resolve cc:insertChildred or cc:insertFacet usages for the current template contextabstract void
setParameter(String key, jakarta.el.ValueExpression value)
Associate the param to the latest template client.
-
-
-
Method Detail
-
popClient
public abstract TemplateManager popClient(AbstractFaceletContext actx)
Pop the last added pushed TemplateClient- See Also:
TemplateClient
-
pushClient
public abstract void pushClient(AbstractFaceletContext actx, AbstractFacelet owner, TemplateClient client)
Push the passed TemplateClient onto the stack for Definition Resolution- Parameters:
client
-- See Also:
TemplateClient
-
popExtendedClient
public abstract TemplateManager popExtendedClient(AbstractFaceletContext actx)
Pop the last added extended TemplateClient- Parameters:
actx
-
-
extendClient
public abstract void extendClient(AbstractFaceletContext actx, AbstractFacelet owner, TemplateClient client)
-
includeDefinition
public abstract boolean includeDefinition(FaceletContext ctx, Facelet owner, UIComponent parent, String name) throws IOException, FaceletException, FacesException, jakarta.el.ELException
This method will walk through the TemplateClient stack to resolve and apply the definition for the passed name. If it's been resolved and applied, this method will return true.- Parameters:
parent
- the UIComponent to apply toname
- name or null of the definition you want to apply- Returns:
- true if successfully applied, otherwise false
- Throws:
IOException
FaceletException
FacesException
jakarta.el.ELException
-
getCompositeComponentClient
public abstract TemplateManager getCompositeComponentClient()
-
setCompositeComponentClient
public abstract void setCompositeComponentClient(TemplateManager compositeComponentClient)
Set the composite component TemplateManager instance, used to resolve cc:insertChildred or cc:insertFacet usages for the current template context
-
getParameter
public abstract jakarta.el.ValueExpression getParameter(String key)
Return the param value expression associated to the key passed, preserving the precedence of each template client.- Parameters:
key
-- Returns:
- Since:
- 2.0.8
-
setParameter
public abstract void setParameter(String key, jakarta.el.ValueExpression value)
Associate the param to the latest template client.- Parameters:
key
-- Since:
- 2.0.8
-
isParameterEmpty
public abstract boolean isParameterEmpty()
Check if no parameters are set.- Returns:
- Since:
- 2.0.8
-
getParameterMap
public abstract Map<String,jakarta.el.ValueExpression> getParameterMap()
- Returns:
- Since:
- 2.0.8
-
isAllowCacheELExpressions
public abstract boolean isAllowCacheELExpressions()
- Returns:
- Since:
- 2.0.8
-
setAllowCacheELExpressions
public abstract void setAllowCacheELExpressions(boolean cacheELExpressions)
- Since:
- 2.0.8
-
containsParameter
public abstract boolean containsParameter(String key)
- Parameters:
key
-- Returns:
- Since:
- 2.1.12
-
getKnownParameters
public abstract Set<String> getKnownParameters()
Return a set of the parameters known associated to this template context and/or template. This logic is used to detect which EL Expressions can be cached or not.- Returns:
- Since:
- 2.1.12
-
containsKnownParameter
public abstract boolean containsKnownParameter(String key)
- Parameters:
key
-- Returns:
- Since:
- 2.1.12
-
isKnownParametersEmpty
public abstract boolean isKnownParametersEmpty()
- Returns:
- Since:
- 2.1.12
-
addKnownParameters
public abstract void addKnownParameters(String knownParameters)
- Parameters:
knownParameters
-- Since:
- 2.1.12
-
-