Package sino.importer

Examples of sino.importer.StationImporterException


                    logger.info("Saved union station: " + unionStation);
                }
                lineNumber++;
            }
        } catch (DaoException e) {
            throw logError(new StationImporterException("Cannot save station.", e));
        } finally {
            scanner.close();
        }
    }
View Full Code Here


                    }

                    if (line.startsWith("##")) {
                        province = line.substring(2);
                        if (province.trim().length() == 0) {
                            throw logError(new StationImporterException("Found empty provice in line " + lineNumber));
                        }
                        logger.info("Provinced changed to: " + province);
                    } else {
                        if (province == null) {
                            throw logError(new StationImporterException("Found station outside province in line "
                                    + lineNumber));
                        }
                        String stationName = line.substring(1);
                        if (stationName.trim().length() == 0) {
                            throw logError(new StationImporterException("Found empty station name in line "
                                    + lineNumber));
                        }
                        chinaStation = new ChinaStation();
                        chinaStation.setName(stationName);
                        chinaStation.setProvince(province);
                    }
                } else {
                    if (chinaStation == null) {
                        throw logError(new StationImporterException(
                                "Found description does not belong to a station in line " + lineNumber));
                    }
                    sb.append(line);
                }
            }
View Full Code Here

            }
            this.provinceStation.put(station.getProvince(), count + 1);
            logger.info("Saved station: " + station);
        } catch (DaoException e) {
            this.entityManager.getTransaction().rollback();
            throw logError(new StationImporterException("Cannot save station.", e));
        }
    }
View Full Code Here

                    logger.info("Saved union station: " + station);
                }
                lineNumber++;
            }
        } catch (DaoException e) {
            throw logError(new StationImporterException("Cannot save station.", e));
        } finally {
            scanner.close();
        }
    }
View Full Code Here

                    logger.info("Saved union station: " + station);
                }
                lineNumber++;
            }
        } catch (DaoException e) {
            throw logError(new StationImporterException("Cannot save station.", e));
        } finally {
            scanner.close();
        }
    }
View Full Code Here

TOP

Related Classes of sino.importer.StationImporterException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.