Class DefaultFacesConfigurationMerger


  • public class DefaultFacesConfigurationMerger
    extends FacesConfigurationMerger
    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 Detail

      • DefaultFacesConfigurationMerger

        public DefaultFacesConfigurationMerger()
    • Method Detail

      • sortRelativeOrderingList

        protected List<FacesConfig> sortRelativeOrderingList​(List<FacesConfig> preOrderedList)
        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