franta-hg@20: package cz.frantovo.langtable; franta-hg@20: franta-hg@20: import cz.frantovo.langtable.Keyboards.*; franta-hg@20: import java.io.File; franta-hg@20: import javax.xml.bind.JAXBContext; franta-hg@20: import javax.xml.bind.JAXBException; franta-hg@20: import javax.xml.bind.Unmarshaller; franta-hg@20: franta-hg@20: /** franta-hg@20: * franta-hg@20: * @author Ing. František Kučera (frantovo.cz) franta-hg@20: */ franta-hg@20: public class LangTable { franta-hg@20: franta-hg@20: /** franta-hg@20: * @param args the command line arguments franta-hg@20: */ franta-hg@20: public static void main(String[] args) throws JAXBException { franta-hg@20: franta-hg@20: franta-hg@20: JAXBContext c = JAXBContext.newInstance(Keyboards.class); franta-hg@20: Unmarshaller u = c.createUnmarshaller(); franta-hg@20: franta-hg@20: long start = System.currentTimeMillis(); franta-hg@20: Object o = u.unmarshal(new File("data/keyboards.xml")); franta-hg@20: System.out.println("Time: " + (System.currentTimeMillis() - start) + " ms"); franta-hg@20: franta-hg@20: Keyboards keyboards = (Keyboards) o; franta-hg@20: franta-hg@20: for (Keyboard k : keyboards.getKeyboards()) { franta-hg@20: System.out.println(k.getId()); franta-hg@20: System.out.println(" " + k.getDescription()); franta-hg@20: System.out.println(" " + k.getComment()); franta-hg@20: System.out.println(" " + k.isAscii()); franta-hg@20: franta-hg@20: System.out.println(" languages: " + k.getLanguages().size()); franta-hg@20: for (Language l : k.getLanguages()) { franta-hg@20: System.out.println(" " + l); franta-hg@20: } franta-hg@20: franta-hg@20: System.out.println(" territories: " + k.getTerritories().size()); franta-hg@20: for (Territory t : k.getTerritories()) { franta-hg@20: System.out.println(" " + t); franta-hg@20: } franta-hg@20: } franta-hg@20: franta-hg@20: franta-hg@20: franta-hg@20: franta-hg@20: } franta-hg@20: }