(Context<?> ctx, Field<?> field)
| 646 | } |
| 647 | |
| 648 | static final Field<?> castForJSON(Context<?> ctx, Field<?> field) { |
| 649 | Formatter f; |
| 650 | |
| 651 | if ((f = field.getBinding().formatter()) != null) { |
| 652 | DefaultFormatterContext fctx = new DefaultFormatterContext(ctx, true, field); |
| 653 | |
| 654 | if (emulateMultiset(ctx.configuration()) == NestedCollectionEmulation.JSONB) |
| 655 | f.formatJSONB(fctx); |
| 656 | else |
| 657 | f.formatJSON(fctx); |
| 658 | |
| 659 | return fctx.formatted; |
| 660 | } |
| 661 | |
| 662 | else if (field.getDataType().isUDTRecord() || field.getDataType().isArray()) { |
| 663 | return toJSONArrays(ctx, field); |
| 664 | } |
| 665 | |
| 666 | return field; |
| 667 | } |
| 668 | |
| 669 | static final Field<?> castForXML(Context<?> ctx, Field<?> field) { |
| 670 | Formatter f; |
no test coverage detected