Top Description Fields Constructors Methods
tools.jackson.jr.ob.impl

public Class BeanPropertyIntrospector

extends Object
Class Inheritance
Imports
java.lang.reflect.*, java.util.*, java.util.function.Function, tools.jackson.jr.ob.JSON, tools.jackson.jr.ob.impl.POJODefinition.Prop, .POJODefinition.PropBuilder

Helper class that jackson-jr uses by default to introspect POJO properties (represented as POJODefinition) to build general POJO readers (deserializers) and writers (serializers).

Note that most of the usage is via ValueReaderLocator and ValueWriterLocator

Field Summary

Modifier and TypeField and Description
private static final BeanPropertyIntrospector
protected static final POJODefinition.Prop[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static <P> P
_addPropertiesFromMap(Map<String, P> props, String name, Function<String, P> propBuilder)

private static Constructor<?>
private static void
_introspect(Class<?> currType, Map<String, POJODefinition.PropBuilder> props, int features, boolean isRecord)

private POJODefinition
_introspectDefinition(Class<?> beanType, boolean forSerialization, int features, boolean isRecord)

private static POJODefinition.PropBuilder
public static void
addNonRecordConstructors(Class<?> beanType, BeanConstructors constructors)

Adds all beanType's 0 and 1 argument declared constructors to constructors.

private static String
decap(String name)

public static <P> Constructor<?>
derivePropertiesFromRecordConstructor(Class<?> beanType, Map<String, P> propsByName, Function<String, P> propBuilder)

Gets canonical constructor of given types and adds properties to the map, derived from constructor parameters.

public static BeanPropertyIntrospector
protected static boolean
isGroovyMetaClass(Class<?> clazz)

Helper method to detect Groovy's problematic metadata accessor type.

public POJODefinition
public POJODefinition
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
private static final BeanPropertyIntrospector INSTANCE
NO_PROPSback to summary
protected static final POJODefinition.Prop[] NO_PROPS

Constructor Detail

BeanPropertyIntrospectorback to summary
public BeanPropertyIntrospector()

Method Detail

_addPropertiesFromMapback to summary
private static <P> P _addPropertiesFromMap(Map<String, P> props, String name, Function<String, P> propBuilder)
_getCanonicalRecordConstructorback to summary
private static Constructor<?> _getCanonicalRecordConstructor(Class<?> beanType)
_introspectback to summary
private static void _introspect(Class<?> currType, Map<String, POJODefinition.PropBuilder> props, int features, boolean isRecord)
_introspectDefinitionback to summary
private POJODefinition _introspectDefinition(Class<?> beanType, boolean forSerialization, int features, boolean isRecord)
_propFromback to summary
private static POJODefinition.PropBuilder _propFrom(Map<String, POJODefinition.PropBuilder> props, String name)
addNonRecordConstructorsback to summary
public static void addNonRecordConstructors(Class<?> beanType, BeanConstructors constructors)

Adds all beanType's 0 and 1 argument declared constructors to constructors.

decapback to summary
private static String decap(String name)
derivePropertiesFromRecordConstructorback to summary
public static <P> Constructor<?> derivePropertiesFromRecordConstructor(Class<?> beanType, Map<String, P> propsByName, Function<String, P> propBuilder)

Gets canonical constructor of given types and adds properties to the map, derived from constructor parameters.

instanceback to summary
public static BeanPropertyIntrospector instance()
isGroovyMetaClassback to summary
protected static boolean isGroovyMetaClass(Class<?> clazz)

Helper method to detect Groovy's problematic metadata accessor type.

Note

Groovy MetaClass have cyclic reference, and hence the class containing it should not be serialized without either removing that reference, or skipping over such references.

pojoDefinitionForDeserializationback to summary
public POJODefinition pojoDefinitionForDeserialization(JSONReader r, Class<?> pojoType)
pojoDefinitionForSerializationback to summary
public POJODefinition pojoDefinitionForSerialization(JSONWriter w, Class<?> pojoType)