FasterXML / FasterXML/jackson-core

Allow registering "string-converter hook", for low-level coercion or String mutation

Ouverte
#355 1 commentaire 7 réactions 0 personnes assignées Voir sur GitHub
3.x most-wanted
Langage dominant
Java
Étoiles
2.4k
Forks
928
Merge moyen
2 j 18 h
PR mergées (30 j)
24

Description

One common wish for processing (at various levels) is to be able to modify incoming String values, to either:

1. Modify Strings themselves (trim whitespace, change casing etc), or
2. Change type of scalar token reported (coercion): for example, change String value "12" into number `12` (`int`)

While such functionality is most often needed for formats like `CSV` and `XML` (and perhaps `properties`), it seems that due to needed across multiple formats this would really make sense as `jackson-core` functionality.

What probably makes sense is to try to figure out abstractions needed, interaction, but require implementations to wire actual activity. In fact, it is almost certainly impossible to do it efficiently and cleanly from within `jackson-core` itself (or from databind).
But it should be possible to implement it in core both for API, and wiring for JSON, and then add similar functionality for other textual (and maybe, if there's demand, for binary?) codecs.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.