java/alt2xml-in-ini/src/cz/frantovo/alt2xml/in/ini/Reader.java
author František Kučera <franta-hg@frantovo.cz>
Sat, 06 Sep 2014 17:19:21 +0200
changeset 76 56b731d14aec
parent 75 java/alt2xml-in-properties/src/cz/frantovo/alt2xml/in/properties/Reader.java@ed9ec17aa67f
child 77 36ee0aefea27
permissions -rw-r--r--
in-ini: skeleton
franta-hg@11
     1
/**
franta-hg@11
     2
 * Alt2XML
franta-hg@11
     3
 * Copyright © 2014 František Kučera (frantovo.cz)
franta-hg@11
     4
 *
franta-hg@11
     5
 * This program is free software: you can redistribute it and/or modify
franta-hg@11
     6
 * it under the terms of the GNU General Public License as published by
franta-hg@11
     7
 * the Free Software Foundation, either version 3 of the License, or
franta-hg@11
     8
 * (at your option) any later version.
franta-hg@11
     9
 *
franta-hg@11
    10
 * This program is distributed in the hope that it will be useful,
franta-hg@11
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@11
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@11
    13
 * GNU General Public License for more details.
franta-hg@11
    14
 *
franta-hg@11
    15
 * You should have received a copy of the GNU General Public License
franta-hg@11
    16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@11
    17
 */
franta-hg@76
    18
package cz.frantovo.alt2xml.in.ini;
franta-hg@2
    19
franta-hg@17
    20
import cz.frantovo.alt2xml.AbstractAlt2XmlReader;
franta-hg@2
    21
import java.io.IOException;
franta-hg@2
    22
import org.xml.sax.InputSource;
franta-hg@2
    23
import org.xml.sax.SAXException;
franta-hg@2
    24
franta-hg@2
    25
/**
franta-hg@2
    26
 *
franta-hg@17
    27
 * @author Ing. František Kučera (frantovo.cz)
franta-hg@2
    28
 */
franta-hg@17
    29
public class Reader extends AbstractAlt2XmlReader {
franta-hg@13
    30
franta-hg@2
    31
	@Override
franta-hg@6
    32
	public void parse(InputSource input) throws IOException, SAXException {
franta-hg@59
    33
		outputStart();
franta-hg@76
    34
		// TODO: INI → SAX
franta-hg@59
    35
		outputEnd();
franta-hg@59
    36
	}
franta-hg@59
    37
franta-hg@59
    38
	private void outputStart() throws SAXException {
franta-hg@21
    39
		contentHandler.startDocument();
franta-hg@76
    40
		contentHandler.lineBreak();
franta-hg@76
    41
		contentHandler.startElement(null, null, "ini", null);
franta-hg@75
    42
		contentHandler.lineBreak();
franta-hg@59
    43
	}
franta-hg@59
    44
franta-hg@59
    45
	private void outputEnd() throws SAXException {
franta-hg@76
    46
		contentHandler.endElement(null, null, "ini");
franta-hg@75
    47
		contentHandler.lineBreak();
franta-hg@21
    48
		contentHandler.endDocument();
franta-hg@6
    49
	}
franta-hg@76
    50
franta-hg@2
    51
}