3 * To change this template file, choose Tools | Templates |
3 * To change this template file, choose Tools | Templates |
4 * and open the template in the editor. |
4 * and open the template in the editor. |
5 */ |
5 */ |
6 package de.unixwork.uwproj; |
6 package de.unixwork.uwproj; |
7 |
7 |
8 import java.io.File; |
|
9 import java.io.FileInputStream; |
|
10 import java.io.FileNotFoundException; |
|
11 import java.io.IOException; |
|
12 import java.util.HashMap; |
|
13 import java.util.LinkedList; |
|
14 import java.util.List; |
|
15 import java.util.Map; |
|
16 import java.util.Properties; |
|
17 import javax.xml.parsers.DocumentBuilder; |
|
18 import javax.xml.parsers.DocumentBuilderFactory; |
|
19 import javax.xml.parsers.ParserConfigurationException; |
|
20 import org.w3c.dom.Document; |
8 import org.w3c.dom.Document; |
21 import org.w3c.dom.Element; |
9 import org.w3c.dom.Element; |
22 import org.w3c.dom.Node; |
10 import org.w3c.dom.Node; |
23 import org.w3c.dom.NodeList; |
11 import org.w3c.dom.NodeList; |
24 import org.xml.sax.SAXException; |
12 |
|
13 import javax.xml.parsers.DocumentBuilder; |
|
14 import javax.xml.parsers.DocumentBuilderFactory; |
|
15 import java.io.File; |
|
16 import java.util.*; |
25 |
17 |
26 /** |
18 /** |
27 * |
19 * |
28 * @author olaf |
20 * @author olaf |
29 */ |
21 */ |
38 private List<Feature> features = new LinkedList<>(); |
30 private List<Feature> features = new LinkedList<>(); |
39 |
31 |
40 private HashMap<String,ConfigVar> configVars = new HashMap<>(); |
32 private HashMap<String,ConfigVar> configVars = new HashMap<>(); |
41 private List<ConfigVar> configVarsList = new LinkedList<>(); |
33 private List<ConfigVar> configVarsList = new LinkedList<>(); |
42 |
34 |
43 public Project(File file) throws ParserConfigurationException, SAXException, IOException, Exception { |
35 public Project(File file) throws Exception { |
44 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); |
36 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); |
45 factory.setNamespaceAware(true); |
37 factory.setNamespaceAware(true); |
46 DocumentBuilder builder = factory.newDocumentBuilder(); |
38 DocumentBuilder builder = factory.newDocumentBuilder(); |
47 Document doc = builder.parse(file); |
39 Document doc = builder.parse(file); |
48 |
40 |