Main.java:2: error: class, interface, or enum expected
public void loadXml(String filepath) throws Exception {
^
Main.java:4: error: class, interface, or enum expected
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
^
Main.java:5: error: class, interface, or enum expected
DocumentBuilder db = null;
^
Main.java:6: error: class, interface, or enum expected
Document doc = null;
^
Main.java:7: error: class, interface, or enum expected
try {
^
Main.java:9: error: class, interface, or enum expected
} catch (ParserConfigurationException e) {
^
Main.java:11: error: class, interface, or enum expected
}
^
Main.java:14: error: class, interface, or enum expected
} catch (SAXException | IOException | NullPointerException e) {
^
Main.java:16: error: class, interface, or enum expected
}
^
Main.java:19: error: class, interface, or enum expected
Node firstChild = root.getFirstChild();
^
Main.java:20: error: class, interface, or enum expected
String tag = firstChild.getNodeName();
^
Main.java:24: error: class, interface, or enum expected
ShapeDrawer drawable = null;
^
Main.java:25: error: class, interface, or enum expected
switch (tag) {
^
Main.java:28: error: class, interface, or enum expected
}
^
Main.java:34: error: class, interface, or enum expected
public void setValues(Element root) {
^
Main.java:37: error: class, interface, or enum expected
nodelist = root.getElementsByTagName("color");
^
Main.java:38: error: class, interface, or enum expected
colorManager.setColor((nodelist.item(0).getTextContent()));
^
Main.java:39: error: class, interface, or enum expected
this.color = colorManager.getCurrentColor();
^
Main.java:40: error: class, interface, or enum expected
System.out.println(color.toString());
^
Main.java:42: error: class, interface, or enum expected
nodelist = root.getElementsByTagName("pressx");
^
Main.java:43: error: class, interface, or enum expected
pressx = Integer.parseInt(nodelist.item(0).getTextContent());
^
Main.java:44: error: class, interface, or enum expected
System.out.println(pressx);
^
Main.java:46: error: class, interface, or enum expected
nodelist = root.getElementsByTagName("pressy");
^
Main.java:47: error: class, interface, or enum expected
pressy = Integer.parseInt(nodelist.item(0).getTextContent());
^
Main.java:48: error: class, interface, or enum expected
System.out.println(pressy);
^
Main.java:50: error: class, interface, or enum expected
nodelist = root.getElementsByTagName("lastx");
^
Main.java:51: error: class, interface, or enum expected
lastx = Integer.parseInt(nodelist.item(0).getTextContent());
^
Main.java:53: error: class, interface, or enum expected
nodelist = root.getElementsByTagName("lasty");
^
Main.java:54: error: class, interface, or enum expected
lasty = Integer.parseInt(nodelist.item(0).getTextContent());
^
Main.java:55: error: class, interface, or enum expected
}
^
Main.java:57: error: class, interface, or enum expected
public void toDOM(Document doc, Element root) {
^
Main.java:59: error: class, interface, or enum expected
Element shapeBranch = doc.createElement("scribble");
^
Main.java:60: error: class, interface, or enum expected
Attr attr1 = doc.createAttribute("hashcode");
^
Main.java:61: error: class, interface, or enum expected
attr1.setValue(((Integer) this.hashCode()).toString());
^
Main.java:62: error: class, interface, or enum expected
shapeBranch.setAttributeNode(attr1);
^
Main.java:63: error: class, interface, or enum expected
root.appendChild(shapeBranch);
^
Main.java:64: error: class, interface, or enum expected
Element eColor = doc.createElement("color");
^
Main.java:65: error: class, interface, or enum expected
eColor.setTextContent(colorManager.namedColorToString(color));
^
Main.java:66: error: class, interface, or enum expected
shapeBranch.appendChild(eColor);
^
Main.java:69: error: class, interface, or enum expected
Element press = doc.createElement("press");
^
Main.java:71: error: class, interface, or enum expected
Attr attr2 = doc.createAttribute("pressx");
^
Main.java:72: error: class, interface, or enum expected
attr2.setValue(((Integer) pressy).toString());
^
Main.java:73: error: class, interface, or enum expected
press.setAttributeNode(attr2);
^
Main.java:75: error: class, interface, or enum expected
Attr attr3 = doc.createAttribute("pressy");
^
Main.java:76: error: class, interface, or enum expected
attr3.setValue(((Integer) pressy).toString());
^
Main.java:77: error: class, interface, or enum expected
press.setAttributeNode(attr3);
^
Main.java:79: error: class, interface, or enum expected
shapeBranch.appendChild(press);
^
Main.java:81: error: class, interface, or enum expected
Element last = doc.createElement("last");
^
Main.java:83: error: class, interface, or enum expected
Attr attr4 = doc.createAttribute("lastx");
^
Main.java:84: error: class, interface, or enum expected
attr4.setValue(((Integer) lastx).toString());
^
Main.java:85: error: class, interface, or enum expected
last.setAttributeNode(attr4);
^
Main.java:87: error: class, interface, or enum expected
Attr attr5 = doc.createAttribute("lasty");
^
Main.java:88: error: class, interface, or enum expected
attr5.setValue(((Integer) lasty).toString());
^
Main.java:89: error: class, interface, or enum expected
last.setAttributeNode(attr5);
^
Main.java:91: error: class, interface, or enum expected
shapeBranch.appendChild(last);
^
Main.java:92: error: class, interface, or enum expected
}
^
56 errors