Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3097

Create Convention that customises which properties are set

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • POJO
    • None

    Description

      Jackson allows for finer grained control over which properties are serialized. The SET_PRIVATE_FIELDS_CONVENTION allows some flexibility by allowing private fields to be set directly. However, this could be extended to allow for greater flexibility.

      An example of the ObjectMapper api allows flexibility for controlling: getter, setter and field properties:

      mapper.setVisibility(IS_GETTER, NONE)
              .setVisibility(GETTER, NONE)
              .setVisibility(SETTER, NONE)
              .setVisibility(FIELD, ANY)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            ross@mongodb.com Ross Lawley
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: