Package org.apache.myfaces.config
Class DefaultFacesConfigurationMerger
java.lang.Object
org.apache.myfaces.spi.FacesConfigurationMerger
org.apache.myfaces.config.DefaultFacesConfigurationMerger
Default impl of the FacesConfigurationMerger-SPI.
This impl gets all FacesConfig data from the current FacesConfigurationProvider SPI impl and merges
it into one FacesConfigData object using the ordering and sorting rules of the Faces spec.
- Author:
- Jakob Korherr
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<FacesConfig>
applySortingAlgorithm
(List<FacesConfig> appConfigResources) Sort using topological ordering algorithm.getFacesConfigData
(ExternalContext externalContext) Returns an object that collect all config information used by MyFaces to initialize the web application.protected List<FacesConfig>
getPostOrderedList
(List<FacesConfig> appConfigResources) Pre Sort the appConfigResources, detecting cyclic references, so when sort process start, it is just necessary to traverse the preOrderedList once.protected void
orderAndFeedArtifacts
(FacesConfigDispenser dispenser, List<FacesConfig> appConfigResources, FacesConfig webAppConfig) protected List<FacesConfig>
sortRelativeOrderingList
(List<FacesConfig> preOrderedList) Sort a list of pre ordered elements.
-
Constructor Details
-
DefaultFacesConfigurationMerger
public DefaultFacesConfigurationMerger()
-
-
Method Details
-
getFacesConfigData
Description copied from class:FacesConfigurationMerger
Returns an object that collect all config information used by MyFaces to initialize the web application.- Specified by:
getFacesConfigData
in classFacesConfigurationMerger
- Returns:
-
orderAndFeedArtifacts
protected void orderAndFeedArtifacts(FacesConfigDispenser dispenser, List<FacesConfig> appConfigResources, FacesConfig webAppConfig) throws FacesException - Throws:
FacesException
-
applySortingAlgorithm
protected List<FacesConfig> applySortingAlgorithm(List<FacesConfig> appConfigResources) throws FacesException Sort using topological ordering algorithm.- Parameters:
appConfigResources
-- Returns:
- Throws:
FacesException
-
sortRelativeOrderingList
Sort a list of pre ordered elements. It scans one by one the elements and apply the conditions mentioned by Ordering object if it is available. The preOrderedList ensures that application config resources referenced by other resources are processed first, making more easier the sort procedure.- Parameters:
preOrderedList
-- Returns:
-
getPostOrderedList
protected List<FacesConfig> getPostOrderedList(List<FacesConfig> appConfigResources) throws FacesException Pre Sort the appConfigResources, detecting cyclic references, so when sort process start, it is just necessary to traverse the preOrderedList once. To do that, we just scan "before" and "after" lists for references, and then those references are traversed again, so the first elements of the pre ordered list does not have references and the next elements has references to the already added ones. The elements on the preOrderedList looks like this: [ no ordering elements , referenced elements ... more referenced elements, before others / after others non referenced elements]- Parameters:
appConfigResources
-- Returns:
- Throws:
FacesException
-