use of net.parostroj.timetable.model.save.NoCloseAllowedReader in project grafikon by jub77.
the class LSSerializerImpl1 method load.
@Override
public TrainDiagram load(Reader reader, LSTrainTypeList trainTypeList) throws LSException {
try {
LSTrainDiagram lsDiagram = (LSTrainDiagram) unmarshaller.unmarshal(new NoCloseAllowedReader(reader));
LSVisitorBuilder builderVisitor = new LSVisitorBuilder(trainTypeList);
lsDiagram.visit(builderVisitor);
return builderVisitor.getTrainDiagram();
} catch (JAXBException e) {
throw new LSException("Cannot load train diagram.", e);
}
}
use of net.parostroj.timetable.model.save.NoCloseAllowedReader in project grafikon by jub77.
the class LSSerializerImpl2 method load.
@Override
public TrainDiagram load(Reader reader, LSTrainTypeList trainTypeList) throws LSException {
try {
LSTrainDiagram lsDiagram = (LSTrainDiagram) unmarshaller.unmarshal(new NoCloseAllowedReader(reader));
LSVisitorBuilder builderVisitor = new LSVisitorBuilder(trainTypeList);
lsDiagram.visit(builderVisitor);
return builderVisitor.getTrainDiagram();
} catch (JAXBException e) {
throw new LSException("Cannot load train diagram.", e);
}
}
Aggregations