001package de.hdm_stuttgart.mi.sd1.htmlformat; 002 003import java.io.FileNotFoundException; 004import java.io.IOException; 005 006/** 007 * Format address data as ordinary text 008 * 009 */ 010public class Address2text { 011 012 /** 013 * @param args unused 014 */ 015 public static void main(String[] args) { 016 final String addressFileName = "addresses.txt"; 017 try { 018 final AddressDataHandler addresses = new AddressDataHandler(addressFileName); 019 020 addresses.printAddresses(System.out, new Address2textFormatter()); 021 } catch (FileNotFoundException e) { 022 System.err.println("File '" + addressFileName + "' not found"); 023 } catch (IOException e){ 024 System.err.println("Unable to read from file '" + addressFileName + "'"); 025 } catch (AddressParseError e) { 026 System.err.println("Error in file '" + addressFileName + "' at line " + e.getErrorOffset() + ":" 027 + e.getMessage()); 028 } 029 } 030}