From: Damyan Ivanov Date: Tue, 29 Sep 2020 19:23:40 +0000 (+0300) Subject: remove references to style members from the parser classes X-Git-Tag: v0.16.0~40 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=47f69abd0ff71ef40d37fc8b9f8693d370f473ea;p=mobile-ledger.git remove references to style members from the parser classes There is a change in 1.19.1 that breaks the parser (precision member changed from plain number to an object). While modifying the parser to be able to try different versions of the API is possible, it is quite a task, and by simple omission of 'astyle' members the parser library ignores the incoming data. This (not providing 'astyle') also seems to work when adding new transactions, at least with hledger-web 1.16.2 --- diff --git a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedAmount.java b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedAmount.java index 3dee4ae9..dd32d8b6 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedAmount.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedAmount.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Damyan Ivanov. + * Copyright © 2020 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -24,7 +24,6 @@ public class ParsedAmount { private String acommodity; private ParsedQuantity aquantity; private boolean aismultiplier; - private ParsedStyle astyle; private ParsedPrice aprice; public ParsedAmount() { } @@ -52,11 +51,4 @@ public class ParsedAmount { public void setAismultiplier(boolean aismultiplier) { this.aismultiplier = aismultiplier; } - public ParsedStyle getAstyle() { - return astyle; - } - public void setAstyle(ParsedStyle astyle) { - this.astyle = astyle; - } - } diff --git a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedBalance.java b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedBalance.java index 24e9ccb0..c2854c0e 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedBalance.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedBalance.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Damyan Ivanov. + * Copyright © 2020 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -25,7 +25,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; public class ParsedBalance { private ParsedQuantity aquantity; private String acommodity; - private ParsedStyle astyle; public ParsedBalance() { } public ParsedQuantity getAquantity() { @@ -41,10 +40,4 @@ public class ParsedBalance { public void setAcommodity(String acommodity) { this.acommodity = acommodity; } - public ParsedStyle getAstyle() { - return astyle; - } - public void setAstyle(ParsedStyle astyle) { - this.astyle = astyle; - } } diff --git a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPosting.java b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPosting.java index 38777684..d773420e 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPosting.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPosting.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Damyan Ivanov. + * Copyright © 2020 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -56,12 +56,6 @@ public class ParsedPosting extends net.ktnx.mobileledger.json.ParsedPosting { qty.setDecimalPlaces(2); qty.setDecimalMantissa(Math.round(acc.getAmount() * 100)); amt.setAquantity(qty); - ParsedStyle style = new ParsedStyle(); - style.setAscommodityside(getCommoditySide()); - style.setAscommodityspaced(getCommoditySpaced()); - style.setAsprecision(2); - style.setAsdecimalpoint('.'); - amt.setAstyle(style); if (acc.getCurrency() != null) amt.setAcommodity(acc.getCurrency()); amounts.add(amt); diff --git a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPrice.java b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPrice.java index 0b93e15f..d3691d66 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPrice.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPrice.java @@ -40,7 +40,6 @@ class ParsedPrice { private ParsedQuantity aquantity; private String acommodity; private boolean aismultiplier; - private ParsedStyle astyle; public Contents() { acommodity = ""; } @@ -68,11 +67,5 @@ class ParsedPrice { public void setAismultiplier(boolean aismultiplier) { this.aismultiplier = aismultiplier; } - public ParsedStyle getAstyle() { - return astyle; - } - public void setAstyle(ParsedStyle astyle) { - this.astyle = astyle; - } } }