private void introspectSerializer ( BeanSerializerBase beanSerializer , CustomType type ) { try { Field propsField = beanSerializer . getClass ( ) . getSuperclass ( ) . getDeclaredField ( "_props" ) ; propsField . setAccessible ( true ) ; BeanPropertyWriter [ ] props = ( BeanPropertyWriter [ ] ) propsField . get ( beanSerializer ) ; for ( BeanPropertyWriter prop : props ) { JavaType propType = prop . getType ( ) ; getType ( propType ) ; String signature = JacksonSignature . createSignature ( propType ) ; type . addBeanProperty ( new BeanProperty ( prop . getName ( ) , signature , prop . getPropertyType ( ) , prop . getMetadata ( ) . getDescription ( ) , prop . getMetadata ( ) . isRequired ( ) ) ) ; } } catch ( NoSuchFieldException e ) { e . printStackTrace ( ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } }
Introspect serializer for java beans