org.optaplanner.core.impl.solver

## Class XStreamXmlSolverFactory<Solution_>

- java.lang.Object
- - org.optaplanner.core.api.solver.SolverFactory<Solution_>
  - - org.optaplanner.core.impl.solver.AbstractSolverFactory<Solution_>
    - - org.optaplanner.core.impl.solver.XStreamXmlSolverFactory<Solution_>

- Type Parameters:
    `Solution_` - the solution type, the class with the `PlanningSolution` annotation

      public class XStreamXmlSolverFactory<Solution_>
      extends AbstractSolverFactory<Solution_>

  XML based configuration that builds a `Solver` with `XStream`.
  See Also:
    `SolverFactory`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected com.thoughtworks.xstream.XStream` | `xStream`

    - ### Fields inherited from class org.optaplanner.core.impl.solver.AbstractSolverFactory

      `solverConfig, solverConfigContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XStreamXmlSolverFactory()`
    `XStreamXmlSolverFactory(SolverConfigContext solverConfigContext)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addXStreamAnnotations(Class<?>... xStreamAnnotations)`
    `static com.thoughtworks.xstream.XStream` | `buildXStream()` Builds the `XStream` setup which is used to read/write `solver configs` and benchmark configs.
    `XStreamXmlSolverFactory<Solution_>` | `configure(File solverConfigFile)`
    `XStreamXmlSolverFactory<Solution_>` | `configure(InputStream in)`
    `XStreamXmlSolverFactory<Solution_>` | `configure(Reader reader)`
    `XStreamXmlSolverFactory<Solution_>` | `configure(String solverConfigResource)`
    `com.thoughtworks.xstream.XStream` | `getXStream()`

    - ### Methods inherited from class org.optaplanner.core.impl.solver.AbstractSolverFactory

      `buildSolver, cloneSolverFactory, getSolverConfig, getSolverConfigContext`

    - ### Methods inherited from class org.optaplanner.core.api.solver.SolverFactory

      `createEmpty, createEmpty, createEmptyFromKieContainer, createEmptyFromKieContainer, createFromKieContainerXmlResource, createFromKieContainerXmlResource, createFromKieContainerXmlResource, createFromXmlFile, createFromXmlFile, createFromXmlInputStream, createFromXmlInputStream, createFromXmlReader, createFromXmlReader, createFromXmlResource, createFromXmlResource`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### xStream

          protected com.thoughtworks.xstream.XStream xStream

  - ### Constructor Detail

    - #### XStreamXmlSolverFactory

          public XStreamXmlSolverFactory()

    - #### XStreamXmlSolverFactory

          public XStreamXmlSolverFactory(SolverConfigContext solverConfigContext)

      Parameters:
        `solverConfigContext` - never null

  - ### Method Detail

    - #### buildXStream

          public static com.thoughtworks.xstream.XStream buildXStream()

      Builds the `XStream` setup which is used to read/write `solver configs` and benchmark configs. It should never be used to read/write `solutions`. Use XStreamSolutionFileIO for that instead.
      Returns:
        never null.

    - #### addXStreamAnnotations

          public void addXStreamAnnotations(Class<?>... xStreamAnnotations)

      Parameters:
        `xStreamAnnotations` - never null
      See Also:
        `XStream.processAnnotations(Class[])`

    - #### getXStream

          public com.thoughtworks.xstream.XStream getXStream()

    - #### configure

          public XStreamXmlSolverFactory<Solution_> configure(String solverConfigResource)

      Parameters:
        `solverConfigResource` - never null, a classpath resource as defined by `ClassLoader.getResource(String)`
      Returns:
        this

    - #### configure

          public XStreamXmlSolverFactory<Solution_> configure(File solverConfigFile)

    - #### configure

          public XStreamXmlSolverFactory<Solution_> configure(InputStream in)

    - #### configure

          public XStreamXmlSolverFactory<Solution_> configure(Reader reader)

Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.