Package org.apache.myfaces.view.facelets
Class FaceletViewDeclarationLanguage
- java.lang.Object
- 
- jakarta.faces.view.ViewDeclarationLanguage
- 
- org.apache.myfaces.view.ViewDeclarationLanguageBase
- 
- org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguageBase
- 
- org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage
 
 
 
 
- 
 public class FaceletViewDeclarationLanguage extends FaceletViewDeclarationLanguageBase This class represents the abstraction of Facelets as a ViewDeclarationLanguage.- Since:
- 2.0
- Version:
- $Revision$ $Date$
- Author:
- Simon Lessard (latest modification by $Author$)
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringBUILDING_VIEW_METADATAstatic StringCACHED_COMPONENT_IDSKey used to cache component ids for the counterstatic StringCLEAN_TRANSIENT_BUILD_ON_RESTOREstatic StringDEFAULT_CHARACTER_ENCODINGstatic longDEFAULT_REFRESH_PERIODstatic longDEFAULT_REFRESH_PERIOD_PRODUCTIONstatic StringDYN_WRAPPERstatic StringGEN_MARK_IDstatic StringIS_BUILDING_INITIAL_STATE_KEY_ALIASstatic StringMARK_INITIAL_STATE_KEYMarker to indicate tag handlers the view currently being built is using partial state saving and it is necessary to call UIComponent.markInitialState after component instances are populated.static StringPARAM_ENCODINGConstant used by EncodingHandler to indicate the current encoding of the page being built, and indicate which one is the response encoding on getResponseEncoding(FacesContext, String) method.static StringREFRESH_TRANSIENT_BUILD_ON_PSSstatic StringREFRESHING_TRANSIENT_BUILDstatic StringREMOVING_COMPONENTS_BUILDstatic StringUSING_PSS_ON_THIS_VIEW- 
Fields inherited from class jakarta.faces.view.ViewDeclarationLanguageFACELETS_VIEW_DECLARATION_LANGUAGE_ID
 
- 
 - 
Constructor SummaryConstructors Constructor Description FaceletViewDeclarationLanguage(FacesContext context)FaceletViewDeclarationLanguage(FacesContext context, ViewDeclarationLanguageStrategy strategy)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildView(FacesContext context, UIViewRoot view)List<String>calculateResourceLibraryContracts(FacesContext context, String viewId)protected StringcalculateViewId(FacesContext context, String viewId)Calculates the effective view identifier for the specified raw view identifier.static voidcleanTransientBuildOnRestore(FacesContext context)protected CompilercreateCompiler(FacesContext context)Creates the Facelet page compiler.UIComponentcreateComponent(FacesContext context, String taglibURI, String tagName, Map<String,Object> attributes)protected FaceletFactorycreateFaceletFactory(FacesContext context, Compiler compiler)Creates a FaceletFactory instance using the specified compiler.protected ResponseWritercreateResponseWriter(FacesContext context)UIViewRootcreateView(FacesContext context, String viewId)Process the specification required algorithm that is generic to all PDL.BeanInfogetComponentMetadata(FacesContext context, Resource componentResource)retargetMethodExpressions(FacesContext, UIComponent) has some clues about the behavior of this methodFaceletFactorygetFaceletFactory()StringgetId()protected StringgetResponseContentType(FacesContext context, String orig)Generate the content typeprotected StringgetResponseEncoding(FacesContext context, String orig)Generate the encodingResourcegetScriptComponentResource(FacesContext context, Resource componentResource)StateManagementStrategygetStateManagementStrategy(FacesContext context, String viewId)ViewMetadatagetViewMetadata(FacesContext context, String viewId)Stream<String>getViews(FacesContext facesContext, String path, int maxDepth, ViewVisitOption... options)protected voidhandleFaceletNotFound(FacesContext context, String viewId)protected voidhandleRenderException(FacesContext context, Exception e)static booleanisBuildingViewMetadata(FacesContext context)Check if the current facelet applied is used to build view metadata.static booleanisCleanTransientBuildOnRestore(FacesContext context)static booleanisMarkInitialState(FacesContext context)static booleanisRefreshingTransientBuild(FacesContext context)static booleanisRefreshTransientBuildOnPSS(FacesContext context)static booleanisRefreshTransientBuildOnPSSAuto(FacesContext context)static booleanisRemovingComponentBuild(FacesContext context)static booleanisUsingPSSOnThisView(FacesContext context)protected voidloadDecorators(FacesContext context, Compiler compiler)Load the various decorators for Facelets.protected voidloadLibraries(FacesContext context, Compiler compiler)Load the various tag libraries for Facelets.protected voidloadOptions(FacesContext context, Compiler compiler)Load the various options for Facelets compiler.voidrenderView(FacesContext context, UIViewRoot view)UIViewRootrestoreView(FacesContext context, String viewId)voidretargetAttachedObjects(FacesContext context, UIComponent topLevelComponent, List<AttachedObjectHandler> handlerList)In short words, this method take care of "target" an "attached object".voidretargetMethodExpressions(FacesContext context, UIComponent topLevelComponent)protected voidsendSourceNotFound(FacesContext context, String message)Send a source not found to the client.booleanviewExists(FacesContext context, String viewId)- 
Methods inherited from class org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguageBaseactivateDynamicComponentRefreshTransientBuild, dynamicComponentNeedsRefresh, getRenderKitFactory, getVisitContextFactory, isDynamicComponentNeedsRefresh, isDynamicComponentRefreshTransientBuildActive, isDynamicComponentRefreshTransientBuildActive, resetDynamicComponentNeedsRefreshFlag
 - 
Methods inherited from class jakarta.faces.view.ViewDeclarationLanguagegetViews
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_REFRESH_PERIODpublic static final long DEFAULT_REFRESH_PERIOD - See Also:
- Constant Field Values
 
 - 
DEFAULT_REFRESH_PERIOD_PRODUCTIONpublic static final long DEFAULT_REFRESH_PERIOD_PRODUCTION - See Also:
- Constant Field Values
 
 - 
DEFAULT_CHARACTER_ENCODINGpublic static final String DEFAULT_CHARACTER_ENCODING - See Also:
- Constant Field Values
 
 - 
PARAM_ENCODINGpublic static final String PARAM_ENCODING Constant used by EncodingHandler to indicate the current encoding of the page being built, and indicate which one is the response encoding on getResponseEncoding(FacesContext, String) method.- See Also:
- Constant Field Values
 
 - 
BUILDING_VIEW_METADATApublic static final String BUILDING_VIEW_METADATA - See Also:
- Constant Field Values
 
 - 
REFRESHING_TRANSIENT_BUILDpublic static final String REFRESHING_TRANSIENT_BUILD - See Also:
- Constant Field Values
 
 - 
REFRESH_TRANSIENT_BUILD_ON_PSSpublic static final String REFRESH_TRANSIENT_BUILD_ON_PSS - See Also:
- Constant Field Values
 
 - 
USING_PSS_ON_THIS_VIEWpublic static final String USING_PSS_ON_THIS_VIEW - See Also:
- Constant Field Values
 
 - 
REMOVING_COMPONENTS_BUILDpublic static final String REMOVING_COMPONENTS_BUILD - See Also:
- Constant Field Values
 
 - 
DYN_WRAPPERpublic static final String DYN_WRAPPER - See Also:
- Constant Field Values
 
 - 
GEN_MARK_IDpublic static final String GEN_MARK_ID - See Also:
- Constant Field Values
 
 - 
MARK_INITIAL_STATE_KEYpublic static final String MARK_INITIAL_STATE_KEY Marker to indicate tag handlers the view currently being built is using partial state saving and it is necessary to call UIComponent.markInitialState after component instances are populated.- See Also:
- Constant Field Values
 
 - 
IS_BUILDING_INITIAL_STATE_KEY_ALIASpublic static final String IS_BUILDING_INITIAL_STATE_KEY_ALIAS - See Also:
- Constant Field Values
 
 - 
CLEAN_TRANSIENT_BUILD_ON_RESTOREpublic static final String CLEAN_TRANSIENT_BUILD_ON_RESTORE - See Also:
- Constant Field Values
 
 - 
CACHED_COMPONENT_IDSpublic static final String CACHED_COMPONENT_IDS Key used to cache component ids for the counter- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
FaceletViewDeclarationLanguagepublic FaceletViewDeclarationLanguage(FacesContext context) 
 - 
FaceletViewDeclarationLanguagepublic FaceletViewDeclarationLanguage(FacesContext context, ViewDeclarationLanguageStrategy strategy) 
 
- 
 - 
Method Detail- 
getIdpublic String getId() - Overrides:
- getIdin class- ViewDeclarationLanguage
 
 - 
viewExistspublic boolean viewExists(FacesContext context, String viewId) - Overrides:
- viewExistsin class- ViewDeclarationLanguage
 
 - 
buildViewpublic void buildView(FacesContext context, UIViewRoot view) throws IOException - Specified by:
- buildViewin class- ViewDeclarationLanguage
- Throws:
- IOException
 
 - 
getComponentMetadatapublic BeanInfo getComponentMetadata(FacesContext context, Resource componentResource) retargetMethodExpressions(FacesContext, UIComponent) has some clues about the behavior of this method- Specified by:
- getComponentMetadatain class- ViewDeclarationLanguage
 
 - 
isBuildingViewMetadatapublic static boolean isBuildingViewMetadata(FacesContext context) Check if the current facelet applied is used to build view metadata.- Parameters:
- context-
- Returns:
 
 - 
isRefreshingTransientBuildpublic static boolean isRefreshingTransientBuild(FacesContext context) 
 - 
isRemovingComponentBuildpublic static boolean isRemovingComponentBuild(FacesContext context) 
 - 
isMarkInitialStatepublic static boolean isMarkInitialState(FacesContext context) 
 - 
isRefreshTransientBuildOnPSSpublic static boolean isRefreshTransientBuildOnPSS(FacesContext context) 
 - 
isRefreshTransientBuildOnPSSAutopublic static boolean isRefreshTransientBuildOnPSSAuto(FacesContext context) 
 - 
isCleanTransientBuildOnRestorepublic static boolean isCleanTransientBuildOnRestore(FacesContext context) 
 - 
cleanTransientBuildOnRestorepublic static void cleanTransientBuildOnRestore(FacesContext context) 
 - 
isUsingPSSOnThisViewpublic static boolean isUsingPSSOnThisView(FacesContext context) 
 - 
retargetAttachedObjectspublic void retargetAttachedObjects(FacesContext context, UIComponent topLevelComponent, List<AttachedObjectHandler> handlerList) In short words, this method take care of "target" an "attached object".- The "attached object" is instantiated by a tag handler.
- The "target" is an object used as "marker", that exposes a List<UIComponent>
 - Overrides:
- retargetAttachedObjectsin class- ViewDeclarationLanguage
 
 - 
retargetMethodExpressionspublic void retargetMethodExpressions(FacesContext context, UIComponent topLevelComponent) - Overrides:
- retargetMethodExpressionsin class- ViewDeclarationLanguage
 
 - 
getScriptComponentResourcepublic Resource getScriptComponentResource(FacesContext context, Resource componentResource) - Specified by:
- getScriptComponentResourcein class- ViewDeclarationLanguage
 
 - 
getStateManagementStrategypublic StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId) - Specified by:
- getStateManagementStrategyin class- ViewDeclarationLanguage
 
 - 
getViewMetadatapublic ViewMetadata getViewMetadata(FacesContext context, String viewId) - Specified by:
- getViewMetadatain class- ViewDeclarationLanguage
 
 - 
renderViewpublic void renderView(FacesContext context, UIViewRoot view) throws IOException - Specified by:
- renderViewin class- ViewDeclarationLanguage
- Throws:
- IOException
 
 - 
createViewpublic UIViewRoot createView(FacesContext context, String viewId) Process the specification required algorithm that is generic to all PDL.- Overrides:
- createViewin class- ViewDeclarationLanguageBase
 
 - 
restoreViewpublic UIViewRoot restoreView(FacesContext context, String viewId) - Overrides:
- restoreViewin class- ViewDeclarationLanguageBase
 
 - 
calculateViewIdprotected String calculateViewId(FacesContext context, String viewId) Calculates the effective view identifier for the specified raw view identifier.- Specified by:
- calculateViewIdin class- ViewDeclarationLanguageBase
- Parameters:
- context- le current FacesContext
- viewId- the raw view identifier
- Returns:
- the effective view identifier
 
 - 
createCompilerprotected Compiler createCompiler(FacesContext context) Creates the Facelet page compiler.- Parameters:
- context- the current FacesContext
- Returns:
- the application's Facelet page compiler
 
 - 
createFaceletFactoryprotected FaceletFactory createFaceletFactory(FacesContext context, Compiler compiler) Creates a FaceletFactory instance using the specified compiler.- Parameters:
- context- the current FacesContext
- compiler- the compiler to be used by the factory
- Returns:
- the factory used by this VDL to load pages
 
 - 
createResponseWriterprotected ResponseWriter createResponseWriter(FacesContext context) throws IOException, FacesException - Throws:
- IOException
- FacesException
 
 - 
getResponseContentTypeprotected String getResponseContentType(FacesContext context, String orig) Generate the content type- Parameters:
- context-
- orig-
- Returns:
 
 - 
getResponseEncodingprotected String getResponseEncoding(FacesContext context, String orig) Generate the encoding- Parameters:
- context-
- orig-
- Returns:
 
 - 
handleFaceletNotFoundprotected void handleFaceletNotFound(FacesContext context, String viewId) throws FacesException, IOException - Throws:
- FacesException
- IOException
 
 - 
handleRenderExceptionprotected void handleRenderException(FacesContext context, Exception e) throws IOException, jakarta.el.ELException, FacesException - Throws:
- IOException
- jakarta.el.ELException
- FacesException
 
 - 
loadDecoratorsprotected void loadDecorators(FacesContext context, Compiler compiler) Load the various decorators for Facelets.- Parameters:
- context- the current FacesContext
- compiler- the page compiler
 
 - 
loadLibrariesprotected void loadLibraries(FacesContext context, Compiler compiler) Load the various tag libraries for Facelets.- Parameters:
- context- the current FacesContext
- compiler- the page compiler
 
 - 
loadOptionsprotected void loadOptions(FacesContext context, Compiler compiler) Load the various options for Facelets compiler. Currently only comment skipping is supported.- Parameters:
- context- the current FacesContext
- compiler- the page compiler
 
 - 
sendSourceNotFoundprotected void sendSourceNotFound(FacesContext context, String message) Send a source not found to the client. Although it can be considered ok in JSP mode, I think it's pretty lame to have this kind of requirement at VDL level considering VDL represents the page --> Faces tree link, not the transport layer required to send a SC_NOT_FOUND.- Specified by:
- sendSourceNotFoundin class- ViewDeclarationLanguageBase
- Parameters:
- context- le current FacesContext
- message- the message associated with the error
 
 - 
calculateResourceLibraryContractspublic List<String> calculateResourceLibraryContracts(FacesContext context, String viewId) - Overrides:
- calculateResourceLibraryContractsin class- ViewDeclarationLanguage
 
 - 
getFaceletFactorypublic FaceletFactory getFaceletFactory() 
 - 
createComponentpublic UIComponent createComponent(FacesContext context, String taglibURI, String tagName, Map<String,Object> attributes) - Overrides:
- createComponentin class- ViewDeclarationLanguage
 
 - 
getViewspublic Stream<String> getViews(FacesContext facesContext, String path, int maxDepth, ViewVisitOption... options) - Overrides:
- getViewsin class- ViewDeclarationLanguage
 
 
- 
 
-