Package jodd.json

Class BeanSerializer


  • public class BeanSerializer
    extends TypeJsonVisitor
    Bean visitor that serializes properties of a bean. It analyzes the rules for inclusion/exclusion of a property.
    • Field Detail

      • source

        protected final java.lang.Object source
    • Constructor Detail

      • BeanSerializer

        public BeanSerializer​(JsonContext jsonContext,
                              java.lang.Object bean)
    • Method Detail

      • serialize

        public void serialize()
        Serializes a bean.
      • onSerializableProperty

        protected final void onSerializableProperty​(java.lang.String propertyName,
                                                    jodd.introspector.PropertyDescriptor propertyDescriptor)
        Reads property value and serializes it.
        Specified by:
        onSerializableProperty in class TypeJsonVisitor
      • onSerializableProperty

        protected void onSerializableProperty​(java.lang.String propertyName,
                                              java.lang.Class propertyType,
                                              java.lang.Object value)
        Invoked on serializable properties, that have passed all the rules. Property type is null for metadata class name property.