Re: Simple Pascal question

Liste des GroupesRevenir à co vms 
Sujet : Re: Simple Pascal question
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vms
Date : 09. Aug 2024, 15:25:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v958sn$om4j$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Mozilla Thunderbird
On 8/9/2024 8:47 AM, Simon Clubley wrote:
On 2024-08-08, Arne Vajhøj <arne@vajhoej.dk> wrote:
On 8/8/2024 8:13 AM, Simon Clubley wrote:
On 2024-08-07, Arne Vajhøj <arne@vajhoej.dk> wrote:
On 8/7/2024 5:35 PM, Lawrence D'Oliveiro wrote:
Dates/times? You have to contend with an API that has accumulated so much
legacy cruft, that you are left with an old class where every single
member is deprecated, yet the class itself is still needed in the newer-
style calls.
>
That is also one of Roland's pet peeves.
>
Now try parsing JSON using the supplied builtin Java libraries
on Android. :-)
>
There is a solution but it is not as clean as elsewhere.
>
I would use binding instead of parsing.
>
I have never done anything on Android, but I would
expect both JSON-B and Jackson to work on Android
 I like to avoid using third-party libraries when possible.
You will have to evaluate benefits vs added size and management.

JSON-B is:
>
Jsonb b = JsonbBuilder.create();
X o = b.fromJson(jsonstr, X.class);
>
Jackson is:
>
ObjectMapper om = new ObjectMapper();
X o = om.readValue(jsonstr, X.class);
>
It don't get much easier than that.
I would probably have listed GSON as well:
Gson gson = new Gson();
X o = gson.fromJson(jsonstr, X.class);
GSON is Google.
But apparently a different team in Google than the one
that does Android.

For comparison, here are the two built-in options available on Android
that I know about:
 https://developer.android.com/reference/android/util/JsonReader
https://developer.android.com/reference/org/json/package-summary
There are 4 types of API's for this:
1) Tree
2) Class binding
3) Streaming
    A) Pull
    B) Push
android.util.JsonReader is a 3A.
org.json.* is a 1.
Given that:
* 1 is cumbersome
* 2 is what you want
* 3A is a PITA
* 3B is a huge PITA
Then I suggest you bite the bullet and go for an external library
that supports class binding.
GSON is less than 300 KB. From Google. Widely used (Maven lists over
23000 other software depending on it) so not likely to go away.
Arne

Date Sujet#  Auteur
1 Aug 24 * Simple Pascal question41Arne Vajhøj
2 Aug 24 `* Re: Simple Pascal question40Uli Bellgardt
3 Aug 24  +* Re: Simple Pascal question38Scott Dorsey
3 Aug 24  i+- Re: Simple Pascal question1Arne Vajhøj
4 Aug 24  i+* Re: Simple Pascal question33Dan Cross
4 Aug 24  ii`* Re: Simple Pascal question32Arne Vajhøj
4 Aug 24  ii +* Re: Simple Pascal question4Lawrence D'Oliveiro
5 Aug 24  ii i+* Re: Simple Pascal question2Arne Vajhøj
5 Aug 24  ii ii`- Re: Simple Pascal question1Lawrence D'Oliveiro
5 Aug 24  ii i`- Re: Simple Pascal question1John Reagan
5 Aug 24  ii `* Re: Simple Pascal question27Dan Cross
5 Aug 24  ii  +* Re: Simple Pascal question24Arne Vajhøj
5 Aug 24  ii  i+* Re: Simple Pascal question3Dan Cross
7 Aug 24  ii  ii`* Re: Simple Pascal question2Arne Vajhøj
8 Aug 24  ii  ii `- Re: Simple Pascal question1Dan Cross
5 Aug 24  ii  i+- Re: Simple Pascal question1Lawrence D'Oliveiro
5 Aug 24  ii  i+* Re: Simple Pascal question5Michael S
5 Aug 24  ii  ii+* Re: Simple Pascal question2Lawrence D'Oliveiro
7 Aug 24  ii  iii`- Re: Simple Pascal question1Arne Vajhøj
7 Aug 24  ii  ii`* Re: Simple Pascal question2Arne Vajhøj
7 Aug 24  ii  ii `- Re: Simple Pascal question1Arne Vajhøj
7 Aug 24  ii  i`* Re: Simple Pascal question14Arne Vajhøj
7 Aug 24  ii  i `* Re: Simple Pascal question13Lawrence D'Oliveiro
8 Aug 24  ii  i  +* Re: Simple Pascal question10Arne Vajhøj
8 Aug 24  ii  i  i`* Re: Simple Pascal question9Simon Clubley
8 Aug 24  ii  i  i `* Re: Simple Pascal question8Arne Vajhøj
8 Aug 24  ii  i  i  +- Re: Simple Pascal question1Arne Vajhøj
9 Aug 24  ii  i  i  `* Re: Simple Pascal question6Simon Clubley
9 Aug 24  ii  i  i   `* Re: Simple Pascal question5Arne Vajhøj
9 Aug 24  ii  i  i    `* Re: Simple Pascal question4Dennis Boone
9 Aug 24  ii  i  i     `* Re: Simple Pascal question3Arne Vajhøj
9 Aug 24  ii  i  i      `* Re: Simple Pascal question2Dennis Boone
10 Aug 24  ii  i  i       `- Re: Simple Pascal question1Lawrence D'Oliveiro
8 Aug 24  ii  i  `* Re: Simple Pascal question2Arne Vajhøj
8 Aug 24  ii  i   `- Re: Simple Pascal question1Lawrence D'Oliveiro
5 Aug 24  ii  `* Re: Simple Pascal question2Arne Vajhøj
5 Aug 24  ii   `- Re: Simple Pascal question1Dan Cross
4 Aug 24  i`* Re: Simple Pascal question3John Reagan
5 Aug 24  i `* Re: Simple Pascal question2Arne Vajhøj
7 Aug 24  i  `- Re: Simple Pascal question1Arne Vajhøj
3 Aug 24  `- Re: Simple Pascal question1Arne Vajhøj

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal