1 | /** |
---|
2 | * This software is copyright (c) 2014 by |
---|
3 | * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) |
---|
4 | * This is free software. You can redistribute it |
---|
5 | * and/or modify it under the terms described in |
---|
6 | * the GNU General Public License v3 of which you |
---|
7 | * should have received a copy. Otherwise you can download |
---|
8 | * it from |
---|
9 | * |
---|
10 | * http://www.gnu.org/licenses/gpl-3.0.txt |
---|
11 | * |
---|
12 | * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) |
---|
13 | * |
---|
14 | * @license http://www.gnu.org/licenses/gpl-3.0.txt |
---|
15 | * GNU General Public License v3 |
---|
16 | */ |
---|
17 | package eu.clarin.cmdi.validator; |
---|
18 | |
---|
19 | import net.sf.saxon.s9api.Processor; |
---|
20 | import net.sf.saxon.s9api.XdmNode; |
---|
21 | |
---|
22 | |
---|
23 | public abstract class CMDIValidatorExtension { |
---|
24 | protected Processor processor; |
---|
25 | |
---|
26 | |
---|
27 | public final void initalize(final Processor processor) |
---|
28 | throws CMDIValidatorInitException { |
---|
29 | if (processor == null) { |
---|
30 | throw new NullPointerException("processor == null"); |
---|
31 | } |
---|
32 | this.processor = processor; |
---|
33 | doInitialize(); |
---|
34 | } |
---|
35 | |
---|
36 | |
---|
37 | public abstract void validate(XdmNode document, |
---|
38 | CMDIValidatorWriteableResult result) throws CMDIValidatorException; |
---|
39 | |
---|
40 | |
---|
41 | protected abstract void doInitialize() throws CMDIValidatorInitException; |
---|
42 | |
---|
43 | } // CMDIValidatorExtension |
---|