@Override public Void visitDouble(Property<Double> property, AbstractModel data) { try { Double value = data.getValue(property); String valueString = (value == null) ? XML_NULL : value.toString(); xml.attribute(null, property.name, valueString); } catch (UnsupportedOperationException e) { // didn't read this value, do nothing } catch (IllegalArgumentException | IllegalStateException | IOException e) { throw new RuntimeException(e); } return null; }
@Override public Void visitLong(Property<Long> property, AbstractModel data) { try { xml.attribute(null, property.name, data.getValue(property).toString()); } catch (UnsupportedOperationException e) { // didn't read this value, do nothing } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (IllegalStateException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } return null; }
@Override public Void visitString(Property<String> property, AbstractModel data) { try { String value = data.getValue(property); if (value == null) { return null; } xml.attribute(null, property.name, value); } catch (UnsupportedOperationException e) { // didn't read this value, do nothing Timber.v(e, e.getMessage()); } catch (IllegalArgumentException | IOException | IllegalStateException e) { throw new RuntimeException(e); } return null; }