Class DefaultPropertyVisibilityStrategy

  • All Implemented Interfaces:
    jakarta.json.bind.config.PropertyVisibilityStrategy, org.apache.johnzon.mapper.Cleanable<java.lang.Class<?>>

    class DefaultPropertyVisibilityStrategy
    extends java.lang.Object
    implements jakarta.json.bind.config.PropertyVisibilityStrategy, org.apache.johnzon.mapper.Cleanable<java.lang.Class<?>>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean skipGetpackage  
      private java.util.concurrent.ConcurrentMap<java.lang.Class<?>,​jakarta.json.bind.config.PropertyVisibilityStrategy> strategies  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clean​(java.lang.Class<?> clazz)  
      private boolean hasMethod​(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Class<?>... paramTypes)  
      private boolean isFieldVisible​(java.lang.reflect.Field field, java.lang.Class<?> root, boolean useGetter)
      If the field is not public then it's of course not visible.
      boolean isVisible​(java.lang.reflect.Field field)  
      boolean isVisible​(java.lang.reflect.Field field, java.lang.Class<?> root, boolean useGetter)  
      boolean isVisible​(java.lang.reflect.Method method)  
      private jakarta.json.bind.config.PropertyVisibilityStrategy visibilityStrategy​(java.lang.Class<?> type)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • strategies

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

        private volatile boolean skipGetpackage
    • Constructor Detail

      • DefaultPropertyVisibilityStrategy

        DefaultPropertyVisibilityStrategy()
    • Method Detail

      • isVisible

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

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

        private boolean isFieldVisible​(java.lang.reflect.Field field,
                                       java.lang.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​(java.lang.Class<?> clazz,
                                  java.lang.String methodName,
                                  java.lang.Class<?>... paramTypes)
      • isVisible

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

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

        public void clean​(java.lang.Class<?> clazz)
        Specified by:
        clean in interface org.apache.johnzon.mapper.Cleanable<java.lang.Class<?>>