# HG changeset patch # User František Kučera # Date 1325598442 -3600 # Node ID 5cfb685d8eec4bc3f0e6d5b44ff463ba86ce9a2e # Parent c2496cf043c3572453c64e63de4faa1511ed9a01 Uspořádání metod. diff -r c2496cf043c3 -r 5cfb685d8eec java/alt2xml/src/cz/frantovo/alt2xml/vstup/SuperReader.java --- a/java/alt2xml/src/cz/frantovo/alt2xml/vstup/SuperReader.java Tue Jan 03 14:45:29 2012 +0100 +++ b/java/alt2xml/src/cz/frantovo/alt2xml/vstup/SuperReader.java Tue Jan 03 14:47:22 2012 +0100 @@ -29,6 +29,27 @@ private Map konfigurace = new HashMap<>(); @Override + public void parse(InputSource input) throws IOException, SAXException { + /** + * TODO: rozpornat formát vstupu a podle toho delegovat + */ + JSONParser p = new JSONParser(); + InputStreamReader vstup = new InputStreamReader(input.getByteStream()); + JsonSimpleContentHandler handler = new JsonSimpleContentHandler(contentHandler); + + try { + p.parse(vstup, handler); + } catch (ParseException e) { + throw new SAXException("Chyba při načítání JSONu", e); + } + } + + @Override + public void parse(String systemId) throws IOException, SAXException { + parse(new InputSource(systemId)); + } + + @Override public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { throw new SAXNotSupportedException("Zatím není podporováno."); } @@ -87,25 +108,4 @@ public ErrorHandler getErrorHandler() { return errorHandler; } - - @Override - public void parse(InputSource input) throws IOException, SAXException { - /** - * TODO: rozpornat formát vstupu a podle toho delegovat - */ - JSONParser p = new JSONParser(); - InputStreamReader vstup = new InputStreamReader(input.getByteStream()); - JsonSimpleContentHandler handler = new JsonSimpleContentHandler(contentHandler); - - try { - p.parse(vstup, handler); - } catch (ParseException e) { - throw new SAXException("Chyba při načítání JSONu", e); - } - } - - @Override - public void parse(String systemId) throws IOException, SAXException { - parse(new InputSource(systemId)); - } }