Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Factory |
|
| 1.0;1 |
1 | package org.jtheque.primary.utils.web.analyzers.generic; | |
2 | ||
3 | import org.jdom.Element; | |
4 | import org.jtheque.core.utils.file.XMLException; | |
5 | import org.jtheque.core.utils.file.XMLReader; | |
6 | ||
7 | /* | |
8 | * This file is part of JTheque. | |
9 | * | |
10 | * JTheque is free software: you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation, either version 3 of the License. | |
13 | * | |
14 | * JTheque is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
21 | */ | |
22 | ||
23 | /** | |
24 | * A XML element factory. | |
25 | * | |
26 | * @author Baptiste Wicht | |
27 | */ | |
28 | public interface Factory<T> { | |
29 | /** | |
30 | * Indicate if the factory can factor with the specified elements. | |
31 | * | |
32 | * @param element The current Element. | |
33 | * @param reader The XML reader. | |
34 | * | |
35 | * @return true if the factory can factor else false. | |
36 | * | |
37 | * @throws XMLException If an error occurs during the XML processing. | |
38 | */ | |
39 | boolean canFactor(Element element, XMLReader reader) throws XMLException; | |
40 | ||
41 | /** | |
42 | * Create and return the factored element. | |
43 | * | |
44 | * @param element The current element. | |
45 | * @param reader The XML reader to use. | |
46 | * | |
47 | * @return The factored element. | |
48 | * | |
49 | * @throws XMLException If an error occurs during the XML processing. | |
50 | */ | |
51 | T factor(Element element, XMLReader reader) throws XMLException; | |
52 | } |