Class ShippingRuleLoader

java.lang.Object
control.ShippingRuleLoader

public class ShippingRuleLoader extends Object
The ShippingRuleLoader class loads shipping rules from a JSON file and provides a method to retrieve them as a list of ShippingRule objects.
See Also:
  • Constructor Details

    • ShippingRuleLoader

      public ShippingRuleLoader()
  • Method Details

    • loadCustomShippingRules

      public static List<ShippingRule> loadCustomShippingRules(String rules_json_path) throws ShippingRuleException
      Loads the shipping rules from the JSON file specified by the parameter.
      Parameters:
      rules_json_path - the path to the JSON file containing the shipping rules
      Returns:
      a list of ShippingRule objects
      Throws:
      ShippingRuleException - if an error occurs while loading the shipping rules
    • loadShippingRules

      public static List<ShippingRule> loadShippingRules() throws ShippingRuleException
      Loads the shipping rules from the JSON file specified by the RULES_FILE constant.
      Returns:
      a list of ShippingRule objects
      Throws:
      ShippingRuleException - if an error occurs while loading the shipping rules