|
|
|
@ -218,10 +218,14 @@ public class TasksXmlExporter {
|
|
|
|
private final XmlWritingPropertyVisitor xmlWritingVisitor = new XmlWritingPropertyVisitor();
|
|
|
|
private final XmlWritingPropertyVisitor xmlWritingVisitor = new XmlWritingPropertyVisitor();
|
|
|
|
|
|
|
|
|
|
|
|
private class XmlWritingPropertyVisitor implements PropertyVisitor<Void, AbstractModel> {
|
|
|
|
private class XmlWritingPropertyVisitor implements PropertyVisitor<Void, AbstractModel> {
|
|
|
|
|
|
|
|
private static final String NULL = "null"; //$NON-NLS-1$
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Void visitInteger(Property<Integer> property, AbstractModel data) {
|
|
|
|
public Void visitInteger(Property<Integer> property, AbstractModel data) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
xml.attribute(null, property.name, data.getValue(property).toString());
|
|
|
|
Integer value = data.getValue(property);
|
|
|
|
|
|
|
|
String valueString = (value == null) ? NULL : value.toString();
|
|
|
|
|
|
|
|
xml.attribute(null, property.name, valueString);
|
|
|
|
} catch (UnsupportedOperationException e) {
|
|
|
|
} catch (UnsupportedOperationException e) {
|
|
|
|
// didn't read this value, do nothing
|
|
|
|
// didn't read this value, do nothing
|
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
|
@ -237,7 +241,9 @@ public class TasksXmlExporter {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Void visitLong(Property<Long> property, AbstractModel data) {
|
|
|
|
public Void visitLong(Property<Long> property, AbstractModel data) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
xml.attribute(null, property.name, data.getValue(property).toString());
|
|
|
|
Long value = data.getValue(property);
|
|
|
|
|
|
|
|
String valueString = (value == null) ? NULL : value.toString();
|
|
|
|
|
|
|
|
xml.attribute(null, property.name, valueString);
|
|
|
|
} catch (UnsupportedOperationException e) {
|
|
|
|
} catch (UnsupportedOperationException e) {
|
|
|
|
// didn't read this value, do nothing
|
|
|
|
// didn't read this value, do nothing
|
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
|
@ -253,7 +259,9 @@ public class TasksXmlExporter {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Void visitDouble(Property<Double> property, AbstractModel data) {
|
|
|
|
public Void visitDouble(Property<Double> property, AbstractModel data) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
xml.attribute(null, property.name, data.getValue(property).toString());
|
|
|
|
Double value = data.getValue(property);
|
|
|
|
|
|
|
|
String valueString = (value == null) ? NULL : value.toString();
|
|
|
|
|
|
|
|
xml.attribute(null, property.name, valueString);
|
|
|
|
} catch (UnsupportedOperationException e) {
|
|
|
|
} catch (UnsupportedOperationException e) {
|
|
|
|
// didn't read this value, do nothing
|
|
|
|
// didn't read this value, do nothing
|
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
|
|