-
Enhancement
-
Resolution: Done
-
Major
-
6.2.0.CR4
-
None
In order to allow users to extend classes in the Solver Configuration and Solver Benchmarked Configuration XML files a set of XStream method needs to be exposed.
The following XStream methods need be added to the XStreamXmlPlannerBenchmarkFactory and XStreamXmlSolverFactory
classes:
XStreamXmlSolverFactory.java
public void alias(String alias, Class clazz) { xStream.alias(alias, clazz); } public void aliasAttribute(Class clazz, String attributeName, String alias) { xStream.aliasAttribute(clazz, attributeName, alias); } public void addDefaultImplementation(Class defaultImplementation, Class ofType) { xStream.addDefaultImplementation(defaultImplementation, ofType); }
For example in order to override the scoreDirectorFactory the following methods would need to be executed:
ConfigureSolver.java
TempXStreamXMLSolverFactory xmlSolverFactory = new TempXStreamXMLSolverFactory(); xmlSolverFactory.aliasAttribute(SolverConfig.class, "scoreDirectorFactoryConfig", "flexScoreDirectorFactory"); xmlSolverFactory.alias("flexScoreDirectorFactory", FlexScoreLevelDirectoryFactoryConfig.class); xmlSolverFactory.addDefaultImplementation(FlexScoreLevelDirectoryFactoryConfig.class, ScoreDirectorFactoryConfig.class); xmlSolverFactory.configure(configPath);