Class JacksonMapperUtil
java.lang.Object
io.quarkus.resteasy.reactive.jackson.runtime.mappers.JacksonMapperUtil
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildReverseNameIndex(com.fasterxml.jackson.databind.PropertyNamingStrategy strategy, String[] translatableFieldNames) Builds a reverse-translation index mapping strategy-translated JSON field names back to Java field names.static com.fasterxml.jackson.databind.JavaTypegetGenericRootType(Type genericType, com.fasterxml.jackson.databind.ObjectWriter defaultWriter) Determine the root type that should be used for serialization of generic types.static com.fasterxml.jackson.databind.JavaType[]getGenericsJavaTypes(com.fasterxml.jackson.databind.DeserializationContext context, com.fasterxml.jackson.databind.BeanProperty property) static booleanincludeSecureField(com.fasterxml.jackson.databind.SerializerProvider serializerProvider, String[] rolesAllowed) static booleanincludeSecureField(String[] rolesAllowed) static booleanisViewIncluded(Class<?> activeView, Class<?>[] viewClasses) static voidserializeCollection(Object value, Class<?> collectionClass, Class<?> elementClass, com.fasterxml.jackson.core.JsonGenerator generator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider) static voidserializePojo(Object value, com.fasterxml.jackson.core.JsonGenerator generator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider) static voidserializePojo(Object value, Object bean, com.fasterxml.jackson.core.JsonGenerator generator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider) static voidserializeUnwrapped(Object value, com.fasterxml.jackson.core.JsonGenerator generator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider) static voidwriteFieldName(com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.PropertyNamingStrategy strategy, String javaFieldName, com.fasterxml.jackson.core.SerializableString defaultName) Writes a field name to the JSON generator, translating through the ObjectMapper'sPropertyNamingStrategyif one is configured.
-
Constructor Details
-
JacksonMapperUtil
public JacksonMapperUtil()
-
-
Method Details
-
isViewIncluded
-
includeSecureField
public static boolean includeSecureField(com.fasterxml.jackson.databind.SerializerProvider serializerProvider, String[] rolesAllowed) -
includeSecureField
-
writeFieldName
public static void writeFieldName(com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.PropertyNamingStrategy strategy, String javaFieldName, com.fasterxml.jackson.core.SerializableString defaultName) throws IOException Writes a field name to the JSON generator, translating through the ObjectMapper'sPropertyNamingStrategyif one is configured. When no strategy is set, the pre-encodeddefaultNameis used for zero overhead.- Throws:
IOException
-
buildReverseNameIndex
public static Map<String,String> buildReverseNameIndex(com.fasterxml.jackson.databind.PropertyNamingStrategy strategy, String[] translatableFieldNames) Builds a reverse-translation index mapping strategy-translated JSON field names back to Java field names. Called once at the start of deserialization so that per-field lookups are O(1) viaMap.getOrDefault(java.lang.Object, V)instead of O(n) scans. -
getGenericRootType
public static com.fasterxml.jackson.databind.JavaType getGenericRootType(Type genericType, com.fasterxml.jackson.databind.ObjectWriter defaultWriter) Determine the root type that should be used for serialization of generic types. Returns the appropriate root type ornullif default serialization should be used. -
getGenericsJavaTypes
public static com.fasterxml.jackson.databind.JavaType[] getGenericsJavaTypes(com.fasterxml.jackson.databind.DeserializationContext context, com.fasterxml.jackson.databind.BeanProperty property) -
serializePojo
public static void serializePojo(Object value, com.fasterxml.jackson.core.JsonGenerator generator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider) throws IOException - Throws:
IOException
-
serializePojo
public static void serializePojo(Object value, Object bean, com.fasterxml.jackson.core.JsonGenerator generator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider) throws IOException - Throws:
IOException
-
serializeCollection
public static void serializeCollection(Object value, Class<?> collectionClass, Class<?> elementClass, com.fasterxml.jackson.core.JsonGenerator generator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider) throws IOException - Throws:
IOException
-
serializeUnwrapped
public static void serializeUnwrapped(Object value, com.fasterxml.jackson.core.JsonGenerator generator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider) throws IOException - Throws:
IOException
-