|
41 | 41 | import org.scijava.table.Table; |
42 | 42 |
|
43 | 43 | @Plugin(type = Service.class) |
44 | | -public class DefaultTableIOService extends AbstractTypedIOService<Table<?, ?>> implements |
45 | | - TableIOService |
| 44 | +public class DefaultTableIOService extends AbstractTypedIOService<Table<?, ?>> |
| 45 | + implements TableIOService |
46 | 46 | { |
47 | 47 |
|
48 | 48 | @Override |
49 | | - public boolean canOpen(Location source) { |
50 | | - IOPlugin<?> opener = ioService().getOpener(source); |
| 49 | + public boolean canOpen(final Location source) { |
| 50 | + final IOPlugin<?> opener = ioService().getOpener(source); |
51 | 51 | if (opener == null) return false; |
52 | 52 | return Table.class.isAssignableFrom(opener.getDataType()); |
53 | 53 | } |
54 | 54 |
|
55 | 55 | @Override |
56 | | - public Table<?, ?> open(String source, TableIOOptions options) throws IOException { |
| 56 | + public Table<?, ?> open(final String source, final TableIOOptions options) |
| 57 | + throws IOException |
| 58 | + { |
57 | 59 | try { |
58 | 60 | return open(locationService().resolve(source), options); |
59 | | - } catch (URISyntaxException e) { |
| 61 | + } |
| 62 | + catch (final URISyntaxException e) { |
60 | 63 | throw new IOException(e); |
61 | 64 | } |
62 | 65 | } |
63 | 66 |
|
64 | 67 | @Override |
65 | | - public Table<?, ?> open(Location source, TableIOOptions options) throws IOException { |
66 | | - IOPlugin<?> opener = ioService().getOpener(source); |
67 | | - if (opener != null && Table.class.isAssignableFrom(opener.getDataType()) |
68 | | - && TableIOPlugin.class.isAssignableFrom(opener.getClass())) { |
69 | | - return ((TableIOPlugin)opener).open(source, options); |
| 68 | + public Table<?, ?> open(final Location source, final TableIOOptions options) |
| 69 | + throws IOException |
| 70 | + { |
| 71 | + final IOPlugin<?> opener = ioService().getOpener(source); |
| 72 | + if (opener != null && Table.class.isAssignableFrom(opener.getDataType()) && |
| 73 | + TableIOPlugin.class.isAssignableFrom(opener.getClass())) |
| 74 | + { |
| 75 | + return ((TableIOPlugin) opener).open(source, options); |
70 | 76 | } |
71 | 77 | throw new UnsupportedOperationException("No compatible opener found."); |
72 | 78 | } |
73 | 79 |
|
74 | 80 | @Override |
75 | | - public void save(Table<?, ?> table, String destination, TableIOOptions options) throws IOException { |
| 81 | + public void save(final Table<?, ?> table, final String destination, |
| 82 | + final TableIOOptions options) throws IOException |
| 83 | + { |
76 | 84 | try { |
77 | 85 | save(table, locationService().resolve(destination), options); |
78 | | - } catch (URISyntaxException e) { |
| 86 | + } |
| 87 | + catch (final URISyntaxException e) { |
79 | 88 | throw new IOException(e); |
80 | 89 | } |
81 | 90 | } |
82 | 91 |
|
83 | 92 | @Override |
84 | | - public void save(Table<?, ?> table, Location destination, TableIOOptions options) throws IOException { |
| 93 | + public void save(final Table<?, ?> table, final Location destination, |
| 94 | + final TableIOOptions options) throws IOException |
| 95 | + { |
85 | 96 | @SuppressWarnings("rawtypes") |
86 | 97 | final IOPlugin<Table> saver = ioService().getSaver(table, destination); |
87 | | - if (saver != null && TableIOPlugin.class.isAssignableFrom(saver.getClass())) { |
88 | | - ((TableIOPlugin)saver).save(table, destination, options); |
| 98 | + if (saver != null && TableIOPlugin.class.isAssignableFrom(saver |
| 99 | + .getClass())) |
| 100 | + { |
| 101 | + ((TableIOPlugin) saver).save(table, destination, options); |
89 | 102 | } |
90 | 103 | else { |
91 | 104 | throw new UnsupportedOperationException("No compatible saver found."); |
|
0 commit comments