Class BeanMetaWithJsonView

java.lang.Object
cn.dinodev.spring.commons.bean.BeanMetaWithJsonView
All Implemented Interfaces:
BeanMeta

public class BeanMetaWithJsonView extends Object implements BeanMeta
带JsonView支持的Bean元信息实现类
Since:
2022-05-28
Author:
Cody Lu
  • Constructor Details

    • BeanMetaWithJsonView

      public BeanMetaWithJsonView(BeanMeta beanMeta, Class<?> activeView)
      构造一个带JsonView支持的BeanMeta实例。

      该构造函数创建一个包装器,用于在指定的JsonView上下文中操作Bean元信息。 所有属性访问操作都会考虑当前激活的JsonView。

      Parameters:
      beanMeta - 被包装的Bean元信息对象
      activeView - 当前激活的JsonView类,用于过滤属性可见性
  • Method Details

    • getActiveView

      public Class<?> getActiveView()
      active json view
      Returns:
      the activeView
    • getBeanClass

      public Class<?> getBeanClass()
      Description copied from interface: BeanMeta
      bean class
      Specified by:
      getBeanClass in interface BeanMeta
      Returns:
      the beanClass
    • getPropertyNames

      public String[] getPropertyNames()
      Description copied from interface: BeanMeta
      bean property names
      Specified by:
      getPropertyNames in interface BeanMeta
      Returns:
      the property names
    • getProperties

      public Property[] getProperties()
      Description copied from interface: BeanMeta
      bean property descriptors of the bean class
      Specified by:
      getProperties in interface BeanMeta
      Returns:
      the property descriptors, or empty array if not found
    • getProperty

      public Property getProperty(String propertyName)
      Description copied from interface: BeanMeta
      bean property descriptor of property name
      Specified by:
      getProperty in interface BeanMeta
      Parameters:
      propertyName -
      Returns:
      the property descriptor, or null if not found
    • getReadableProperties

      public Property[] getReadableProperties()
      Description copied from interface: BeanMeta
      readable property descriptors
      Specified by:
      getReadableProperties in interface BeanMeta
      Returns:
      the readable property descriptors, or empty array if not found
    • getWritableProperties

      public Property[] getWritableProperties()
      Description copied from interface: BeanMeta
      writable property descriptors
      Specified by:
      getWritableProperties in interface BeanMeta
      Returns:
      the writable property descriptors, or empty array if not found
    • getReadablePropertyNames

      public String[] getReadablePropertyNames()
      Description copied from interface: BeanMeta
      readable property names
      Specified by:
      getReadablePropertyNames in interface BeanMeta
      Returns:
      the readable property names, or empty array if not found
    • getWritablePropertyNames

      public String[] getWritablePropertyNames()
      Description copied from interface: BeanMeta
      writable property names
      Specified by:
      getWritablePropertyNames in interface BeanMeta
      Returns:
      the writable property names, or empty array if not found
    • getUnreadablePropertyNames

      public String[] getUnreadablePropertyNames()
      Description copied from interface: BeanMeta
      unreadable property names
      Specified by:
      getUnreadablePropertyNames in interface BeanMeta
      Returns:
      the unreadable property names, or empty array if not found
    • getUnreadableProperties

      public Property[] getUnreadableProperties()
      Description copied from interface: BeanMeta
      unreadable property descriptors
      Specified by:
      getUnreadableProperties in interface BeanMeta
      Returns:
      the unreadable property descriptors, or empty array if not found
    • getUnwritablePropertyNames

      public String[] getUnwritablePropertyNames()
      Description copied from interface: BeanMeta
      unwritable property names
      Specified by:
      getUnwritablePropertyNames in interface BeanMeta
      Returns:
      the unwritable property names, or empty array if not found
    • getUnwritableProperties

      public Property[] getUnwritableProperties()
      Description copied from interface: BeanMeta
      unwritable property descriptors
      Specified by:
      getUnwritableProperties in interface BeanMeta
      Returns:
      the unwritable property descriptors, or empty array if not found
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object