
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get JSONFactory Settings Using Jackson in Java
The JsonFactory class is a thread-safe and responsible for creating instances of writer and reader. The list of settings that can be turned on/off is present in an enumeration JsonFactory.Feature, it contains static method values() that return the enum constant of this type with the specified name.
Syntax
public static enum JsonFactory.Feature extends Enum<JsonFactory.Feature>
Example
import com.fasterxml.jackson.core.JsonFactory; public class JsonFactorySettingsTest { public static void main(String[] args) { JsonFactory jsonFactory = new JsonFactory(); for(JsonFactory.Feature feature : JsonFactory.Feature.values()) { boolean result = jsonFactory.isEnabled(feature); System.out.println(feature.name() + ":" + result); } } }
Output
INTERN_FIELD_NAMES:true CANONICALIZE_FIELD_NAMES:true FAIL_ON_SYMBOL_HASH_OVERFLOW:true USE_THREAD_LOCAL_FOR_BUFFER_RECYCLING:true
Advertisements