Class DefaultResourceConfigSortComparator

  • All Implemented Interfaces:
    Comparator<org.smooks.api.resource.config.ResourceConfig>, org.smooks.api.resource.config.ResourceConfigSortComparator

    public class DefaultResourceConfigSortComparator
    extends Object
    implements org.smooks.api.resource.config.ResourceConfigSortComparator
    • Constructor Detail

      • DefaultResourceConfigSortComparator

        public DefaultResourceConfigSortComparator​(org.smooks.api.profile.ProfileSet profileSet)
        Private constructor.
        Parameters:
        profileSet - Profile set used to evaluate specificity.
    • Method Detail

      • compare

        public int compare​(org.smooks.api.resource.config.ResourceConfig configObj1,
                           org.smooks.api.resource.config.ResourceConfig configObj2)
        Specified by:
        compare in interface Comparator<org.smooks.api.resource.config.ResourceConfig>
      • getSpecificity

        protected double getSpecificity​(org.smooks.api.resource.config.ResourceConfig resourceConfig)
        Get the specificity of the ResourceConfig.

        The "specificity" is evaluated based on the selector and target-profile values.

        Parameters:
        resourceConfig - Resource configuration.
        Returns:
        Configuration specificity.