/** * Get a controller that can be used to execute functions in this compiled query. Functions in the * query module can be found using {@link QueryModule#getUserDefinedFunction}. They can then be * called directly from the Java application using {@link * org.orbeon.saxon.instruct.UserFunction#call} The same Controller can be used for a series of * function calls. Note that the Controller should only be used in a single thread. * * @return a newly constructed Controller */ public Controller newController() { Controller controller = new Controller(executable.getConfiguration(), executable); executable.initializeBindery(controller.getBindery()); if (isUpdating && controller.getTreeModel() == Builder.TINY_TREE) { controller.setTreeModel(Builder.LINKED_TREE); } return controller; }