| 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 2 | // Copyright (c) 2018 Saxonica Limited. |
| 3 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. |
| 4 | // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 | // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. |
| 6 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 7 | |
| 8 | package net.sf.saxon.lib; |
| 9 | |
| 10 | import net.sf.saxon.Configuration; |
| 11 | |
| 12 | import javax.xml.transform.TransformerException; |
| 13 | |
| 14 | /** |
| 15 | * This interface can be implemented by users (there are no implementations in Saxon itself). It is |
| 16 | * used only when Saxon is invoked from the command line, and the -init:class option is used on the command |
| 17 | * line to nominate an implementation of this class. The initialize() method of the supplied class will |
| 18 | * then be called to perform any user-defined initialization of the Configuration. |
| 19 | * <p>The initializer is invoked after all other options on the command line have been processed; the initializer |
| 20 | * can therefore examine the Configuration to see what options have been set, and it can modify them accordingly.</p> |
| 21 | * |
| 22 | * @since 9.3 |
| 23 | */ |
| 24 | public interface Initializer { |
| 25 | |
| 26 | /** |
| 27 | * Initialize the Configuration |
| 28 | * |
| 29 | * @param config the Configuration to be initialized |
| 30 | * @throws TransformerException if the initializer chooses to abort processing for any reason |
| 31 | */ |
| 32 | |
| 33 | void initialize(Configuration config) throws TransformerException; |
| 34 | } |
| 35 |