První nástřel – trochu už to funguje, převádí JSON na XML.
1 package cz.frantovo.alt2xml;
3 import java.util.logging.Level;
4 import java.util.logging.Logger;
5 import javax.xml.parsers.SAXParser;
6 import org.xml.sax.Parser;
7 import org.xml.sax.SAXException;
8 import org.xml.sax.SAXNotRecognizedException;
9 import org.xml.sax.SAXNotSupportedException;
10 import org.xml.sax.XMLReader;
16 public class AltParser extends SAXParser {
18 private static final Logger log = Logger.getLogger(AltParser.class.getName());
19 private XMLReader superReader = new SuperReader();
22 public Parser getParser() throws SAXException {
24 log.log(Level.FINE, "getParser");
29 public XMLReader getXMLReader() throws SAXException {
34 public boolean isNamespaceAware() {
36 log.log(Level.FINE, "isNamespaceAware");
41 public boolean isValidating() {
43 log.log(Level.FINE, "isValidating");
48 public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException {
50 log.log(Level.FINE, "setProperty: {0} = {1}", new Object[]{name, value});
54 public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
56 log.log(Level.FINE, "getProperty: {0}", name);