public class FaceletViewHandlingStrategy extends ViewHandlingStrategy
ViewHandlingStrategy
handles Facelets/PDL-based views.Modifier and Type | Class and Description |
---|---|
private static class |
FaceletViewHandlingStrategy.CompCompInterfaceMethodMetadata
Utility class to encapsulate the ValueExpression evaluation of the various
MethodExpression composite component properties.
|
private static class |
FaceletViewHandlingStrategy.MethodMetadataIterator
Provides iteration services over a composite component's
MethodExpression-enabled
PropertyDescriptors . |
private static interface |
FaceletViewHandlingStrategy.MethodRetargetHandler
Implementations of this interface provide the
strategy to
properly retarget a method expression for a particular attribute. |
private static class |
FaceletViewHandlingStrategy.MethodRetargetHandlerManager
Managed the
MethodRetargetHandler implementations for the
current MethodExpression enabled component attributes:
action
actionListener
validator
valueChangeListener
Instances of this object also provide a default handler that can be
used to re-target MethodExperssions that don't match
on of the four names described above. |
protected static class |
FaceletViewHandlingStrategy.NullWriter
Simple no-op writer.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
contractMappings |
private java.lang.String[] |
extensionsArray |
private DefaultFaceletFactory |
faceletFactory |
private boolean |
groovyAvailable |
static java.lang.String |
IS_BUILDING_METADATA |
private boolean |
isTrinidadStateManager |
private static java.util.logging.Logger |
LOGGER |
private Cache<javax.faces.application.Resource,java.beans.BeanInfo> |
metadataCache |
private java.lang.String[] |
prefixesArray |
static java.lang.String |
RESOURCE_LIBRARY_CONTRACT_DATA_STRUCTURE_KEY |
private int |
responseBufferSize |
private boolean |
responseBufferSizeSet |
private FaceletViewHandlingStrategy.MethodRetargetHandlerManager |
retargetHandlerManager |
private static java.lang.String |
SKIP_ITERATION_HINT
Stores the skip hint.
|
private javax.faces.view.ViewDeclarationLanguageFactory |
vdlFactory |
associate, webConfig
Constructor and Description |
---|
FaceletViewHandlingStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
buildView(javax.faces.context.FacesContext ctx,
javax.faces.component.UIViewRoot view)
Build the view.
|
java.util.List<java.lang.String> |
calculateResourceLibraryContracts(javax.faces.context.FacesContext context,
java.lang.String viewId) |
javax.faces.component.UIComponent |
createComponent(javax.faces.context.FacesContext context,
java.lang.String taglibURI,
java.lang.String tagName,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
java.beans.BeanInfo |
createComponentMetadata(javax.faces.context.FacesContext context,
javax.faces.application.Resource ccResource) |
protected javax.faces.context.ResponseWriter |
createResponseWriter(javax.faces.context.FacesContext context) |
javax.faces.component.UIViewRoot |
createView(javax.faces.context.FacesContext ctx,
java.lang.String viewId) |
private void |
doPostBuildActions(javax.faces.context.FacesContext ctx,
javax.faces.component.UIViewRoot root) |
java.beans.BeanInfo |
getComponentMetadata(javax.faces.context.FacesContext context,
javax.faces.application.Resource ccResource) |
private java.lang.String |
getCompositeComponentName(javax.faces.component.UIComponent compositeComponent) |
java.lang.String |
getId() |
protected java.lang.String |
getResponseContentType(javax.faces.context.FacesContext context,
java.lang.String orig) |
protected java.lang.String |
getResponseEncoding(javax.faces.context.FacesContext context,
java.lang.String orig) |
javax.faces.application.Resource |
getScriptComponentResource(javax.faces.context.FacesContext context,
javax.faces.application.Resource componentResource) |
private javax.servlet.http.HttpSession |
getSession(javax.faces.context.FacesContext context)
Get a session (if we are using server state saving).
|
javax.faces.view.StateManagementStrategy |
getStateManagementStrategy(javax.faces.context.FacesContext context,
java.lang.String viewId) |
javax.faces.view.ViewMetadata |
getViewMetadata(javax.faces.context.FacesContext context,
java.lang.String viewId) |
protected void |
handleFaceletNotFound(javax.faces.context.FacesContext context,
java.lang.String viewId,
java.lang.String message)
Handles the case where a Facelet cannot be found.
|
protected void |
handleRenderException(javax.faces.context.FacesContext context,
java.lang.Exception e)
Handles the case where rendering throws an Exception.
|
boolean |
handlesViewId(java.lang.String viewId) |
protected void |
initialize()
Initialize the core Facelets runtime.
|
protected void |
initializeMappings()
Initialize mappings, during the first request.
|
static boolean |
isBuildingMetadata(javax.faces.context.FacesContext context) |
private boolean |
isMatchedWithFaceletsSuffix(java.lang.String viewId) |
private boolean |
isServerStateSaving()
Are we saving state server side?
|
private javax.faces.component.UIComponent |
locateComponentByClientId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent parent,
java.lang.String clientId)
Find the given component in the component tree.
|
private void |
markInitialState(javax.faces.context.FacesContext ctx,
javax.faces.component.UIViewRoot root) |
private void |
markInitialState(javax.faces.component.UIComponent component) |
private void |
markInitialStateIfNotMarked(javax.faces.component.UIComponent component)
Mark the initial state if not already marked.
|
private void |
reapplyDynamicActions(javax.faces.context.FacesContext context)
Reapply the dynamic actions after Facelets reapply.
|
private void |
reapplyDynamicAdd(javax.faces.context.FacesContext context,
ComponentStruct struct)
Reapply the dynamic add after Facelets reapply.
|
private void |
reapplyDynamicRemove(javax.faces.context.FacesContext context,
ComponentStruct struct)
Reapply the dynamic remove after Facelets reapply.
|
void |
renderView(javax.faces.context.FacesContext ctx,
javax.faces.component.UIViewRoot viewToRender) |
javax.faces.component.UIViewRoot |
restoreView(javax.faces.context.FacesContext context,
java.lang.String viewId)
If
UIDebug.debugRequest(javax.faces.context.FacesContext) } is true ,
simply return a new UIViewRoot(), otherwise, call the default logic. |
void |
retargetAttachedObjects(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent topLevelComponent,
java.util.List<javax.faces.view.AttachedObjectHandler> handlers) |
private void |
retargetHandler(javax.faces.context.FacesContext context,
javax.faces.view.AttachedObjectHandler handler,
javax.faces.component.UIComponent targetComponent) |
void |
retargetMethodExpressions(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent topLevelComponent) |
boolean |
viewExists(javax.faces.context.FacesContext context,
java.lang.String viewId) |
private static final java.util.logging.Logger LOGGER
private javax.faces.view.ViewDeclarationLanguageFactory vdlFactory
private DefaultFaceletFactory faceletFactory
private java.lang.String[] extensionsArray
private java.lang.String[] prefixesArray
public static final java.lang.String IS_BUILDING_METADATA
public static final java.lang.String RESOURCE_LIBRARY_CONTRACT_DATA_STRUCTURE_KEY
private FaceletViewHandlingStrategy.MethodRetargetHandlerManager retargetHandlerManager
private boolean groovyAvailable
private int responseBufferSize
private boolean responseBufferSizeSet
private boolean isTrinidadStateManager
private Cache<javax.faces.application.Resource,java.beans.BeanInfo> metadataCache
private java.util.Map<java.lang.String,java.util.List<java.lang.String>> contractMappings
private static java.lang.String SKIP_ITERATION_HINT
public static boolean isBuildingMetadata(javax.faces.context.FacesContext context)
public javax.faces.view.StateManagementStrategy getStateManagementStrategy(javax.faces.context.FacesContext context, java.lang.String viewId)
getStateManagementStrategy
in class javax.faces.view.ViewDeclarationLanguage
public java.beans.BeanInfo getComponentMetadata(javax.faces.context.FacesContext context, javax.faces.application.Resource ccResource)
getComponentMetadata
in class javax.faces.view.ViewDeclarationLanguage
public java.beans.BeanInfo createComponentMetadata(javax.faces.context.FacesContext context, javax.faces.application.Resource ccResource)
public javax.faces.view.ViewMetadata getViewMetadata(javax.faces.context.FacesContext context, java.lang.String viewId)
getViewMetadata
in class javax.faces.view.ViewDeclarationLanguage
public javax.faces.application.Resource getScriptComponentResource(javax.faces.context.FacesContext context, javax.faces.application.Resource componentResource)
getScriptComponentResource
in class javax.faces.view.ViewDeclarationLanguage
ViewDeclarationLanguage.getScriptComponentResource(javax.faces.context.FacesContext, javax.faces.application.Resource)
public void renderView(javax.faces.context.FacesContext ctx, javax.faces.component.UIViewRoot viewToRender) throws java.io.IOException
renderView
in class javax.faces.view.ViewDeclarationLanguage
java.io.IOException
ViewDeclarationLanguage.renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)
private boolean isServerStateSaving()
private javax.servlet.http.HttpSession getSession(javax.faces.context.FacesContext context)
context
- the Faces context.public javax.faces.component.UIViewRoot restoreView(javax.faces.context.FacesContext context, java.lang.String viewId)
If UIDebug.debugRequest(javax.faces.context.FacesContext)
} is true
,
simply return a new UIViewRoot(), otherwise, call the default logic.
restoreView
in class ViewHandlingStrategy
ViewDeclarationLanguage.restoreView(javax.faces.context.FacesContext, java.lang.String)
public void retargetAttachedObjects(javax.faces.context.FacesContext context, javax.faces.component.UIComponent topLevelComponent, java.util.List<javax.faces.view.AttachedObjectHandler> handlers)
retargetAttachedObjects
in class javax.faces.view.ViewDeclarationLanguage
ViewDeclarationLanguage.retargetAttachedObjects(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.util.List)
public void retargetMethodExpressions(javax.faces.context.FacesContext context, javax.faces.component.UIComponent topLevelComponent)
retargetMethodExpressions
in class javax.faces.view.ViewDeclarationLanguage
ViewDeclarationLanguage.retargetMethodExpressions(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
public javax.faces.component.UIViewRoot createView(javax.faces.context.FacesContext ctx, java.lang.String viewId)
createView
in class ViewHandlingStrategy
ViewDeclarationLanguage.createView(javax.faces.context.FacesContext, java.lang.String)
public javax.faces.component.UIComponent createComponent(javax.faces.context.FacesContext context, java.lang.String taglibURI, java.lang.String tagName, java.util.Map<java.lang.String,java.lang.Object> attributes)
createComponent
in class javax.faces.view.ViewDeclarationLanguage
public java.util.List<java.lang.String> calculateResourceLibraryContracts(javax.faces.context.FacesContext context, java.lang.String viewId)
calculateResourceLibraryContracts
in class javax.faces.view.ViewDeclarationLanguage
public boolean handlesViewId(java.lang.String viewId)
handlesViewId
in class ViewHandlingStrategy
viewId
- the view ID to checktrue
if assuming a default configuration and the
view ID's extension is .xhtml
Otherwise try to match
the view ID based on the configured extendsion and prefixes.WebConfiguration.WebContextInitParameter.FaceletsViewMappings
private boolean isMatchedWithFaceletsSuffix(java.lang.String viewId)
private void markInitialStateIfNotMarked(javax.faces.component.UIComponent component)
public void buildView(javax.faces.context.FacesContext ctx, javax.faces.component.UIViewRoot view) throws java.io.IOException
buildView
in class javax.faces.view.ViewDeclarationLanguage
ctx
- the FacesContext
for the current requestview
- the UIViewRoot
to populate based
of the Facelet templatejava.io.IOException
- if an error occurs building the view.public boolean viewExists(javax.faces.context.FacesContext context, java.lang.String viewId)
viewExists
in class javax.faces.view.ViewDeclarationLanguage
public java.lang.String getId()
getId
in class javax.faces.view.ViewDeclarationLanguage
protected void initialize()
protected void initializeMappings()
protected javax.faces.context.ResponseWriter createResponseWriter(javax.faces.context.FacesContext context) throws java.io.IOException
context
- the FacesContext
for the current requestResponseWriter
for processing the requestjava.io.IOException
- if the writer cannot be createdprotected void handleRenderException(javax.faces.context.FacesContext context, java.lang.Exception e) throws java.io.IOException
context
- the FacesContext
for the current requeste
- the caught Exceptionjava.io.IOException
- if the custom debug content cannot be writtenprotected void handleFaceletNotFound(javax.faces.context.FacesContext context, java.lang.String viewId, java.lang.String message) throws java.io.IOException
context
- the FacesContext
for the current requestviewId
- the view ID that was to be mapped to a Faceletmessage
- optional message to include in the 404java.io.IOException
- if an error occurs sending the 404 to the clientprotected java.lang.String getResponseEncoding(javax.faces.context.FacesContext context, java.lang.String orig)
context
- the FacesContext
for the current requestorig
- the original encodingprotected java.lang.String getResponseContentType(javax.faces.context.FacesContext context, java.lang.String orig)
context
- the FacesContext
for the current requestorig
- the original contentTypeprivate java.lang.String getCompositeComponentName(javax.faces.component.UIComponent compositeComponent)
private void doPostBuildActions(javax.faces.context.FacesContext ctx, javax.faces.component.UIViewRoot root)
private void markInitialState(javax.faces.context.FacesContext ctx, javax.faces.component.UIViewRoot root)
private void markInitialState(javax.faces.component.UIComponent component)
private void retargetHandler(javax.faces.context.FacesContext context, javax.faces.view.AttachedObjectHandler handler, javax.faces.component.UIComponent targetComponent)
private javax.faces.component.UIComponent locateComponentByClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent, java.lang.String clientId)
context
- the Faces context.clientId
- the client id of the component to find.private void reapplyDynamicActions(javax.faces.context.FacesContext context)
Note a precondition to this method is that tracking view modifications is turned off during the execution of this method. The caller of this method is responsible for turning tracking view modifications off and on as required.
context
- the Faces context.private void reapplyDynamicAdd(javax.faces.context.FacesContext context, ComponentStruct struct)
context
- the Faces context.struct
- the component struct.private void reapplyDynamicRemove(javax.faces.context.FacesContext context, ComponentStruct struct)
context
- the Faces context.struct
- the component struct.Copyright © 2002-2013 Oracle America, Inc. All Rights Reserved.