Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-782

Support JSON solver configuration too with SolverFactory.createFromJsonResource

    XMLWordPrintable

Details

    • NEW
    • NEW

    Description

      We could easily support both xml and json for solver configs, by adding SolverFactory.createFromJson*() methods:
      https://github.com/kiegroup/optaplanner/blob/master/optaplanner-core/src/main/java/org/optaplanner/core/api/solver/SolverFactory.java#L88

      XStream supports JSON too, so it's just a matter of copy XStreamXmlSolverFactory and using a different XStream setup:
      https://github.com/kiegroup/optaplanner/blob/master/optaplanner-core/src/main/java/org/optaplanner/core/impl/solver/XStreamXmlSolverFactory.java#L50

      We'll probably want to rename XStreamXmlSolverFactory to XStreamSolverFactory and then make the json/xml switch a boolean constructor parameter?

      Attachments

        Activity

          People

            Unassigned Unassigned
            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: