Class DefaultPropertyVisibilityStrategy

  • All Implemented Interfaces:
    jakarta.json.bind.config.PropertyVisibilityStrategy, Cleanable<Class<?>>

    class DefaultPropertyVisibilityStrategy
    extends Object
    implements jakarta.json.bind.config.PropertyVisibilityStrategy, Cleanable<Class<?>>
    • Field Detail

      • strategies

        private final ConcurrentMap<Class<?>,​jakarta.json.bind.config.PropertyVisibilityStrategy> strategies
      • skipGetpackage

        private volatile boolean skipGetpackage
    • Constructor Detail

      • DefaultPropertyVisibilityStrategy

        DefaultPropertyVisibilityStrategy()
    • Method Detail

      • isVisible

        public boolean isVisible​(Field field)
        Specified by:
        isVisible in interface jakarta.json.bind.config.PropertyVisibilityStrategy
      • isVisible

        public boolean isVisible​(Field field,
                                 Class<?> root,
                                 boolean useGetter)
      • isFieldVisible

        private boolean isFieldVisible​(Field field,
                                       Class<?> root,
                                       boolean useGetter)
        If the field is not public then it's of course not visible. If the field is public then we need to look at the accessors. If there is a private/protected/default accessor for it then it overrides and the field is not visible But if there is no accessor for it, then it's visible.
      • hasMethod

        private boolean hasMethod​(Class<?> clazz,
                                  String methodName,
                                  Class<?>... paramTypes)
      • isVisible

        public boolean isVisible​(Method method)
        Specified by:
        isVisible in interface jakarta.json.bind.config.PropertyVisibilityStrategy
      • visibilityStrategy

        private jakarta.json.bind.config.PropertyVisibilityStrategy visibilityStrategy​(Class<?> type)