Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Add the jackson-databind 2.9.4 library to your project. Create and implement the ObjectMapper object to map all properties of the ContactApp class. Test the file
- Add the jackson-databind 2.9.4 library to your project.
- Create and implement the ObjectMapper object to map all properties of the ContactApp class.
- Test the file IO and implement decorators according to the Jackson documentation.
- You should use @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS) for the BaseContact class.
- You should use @JsonIgnore annotations where you do not wish to include the output of a class in a JSON file. For example, the get() methods do not need to be included in an object mapping.
- Create the saveRecords() method in FileAccessService that writes all records to a JSON file. Implement the readAllRecords() method, which should also be in the FileAccessService class. Overwrite the existing file. Call this method just before exiting the main() program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started