Class DriverExclusionStrategy

  • All Implemented Interfaces:
    com.google.gson.ExclusionStrategy

    public class DriverExclusionStrategy
    extends java.lang.Object
    implements com.google.gson.ExclusionStrategy
    This exclusion strategy makes sure to skip serialization of any classes implementing the WebDriver interface. Since this object is redundant when reporting command parameters and doesn’t pass serialization - we exclude it. See https://github.com/google/gson/issues/1540 for more details on the serialization problem
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean shouldSkipClass​(java.lang.Class<?> clazz)
      Determines whether the class implements a WebDriver interface and should be ignored.
      boolean shouldSkipField​(com.google.gson.FieldAttributes f)
      Determined whether a filed should be skipped.
      • Methods inherited from class java.lang.Object

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

      • DriverExclusionStrategy

        public DriverExclusionStrategy()
    • Method Detail

      • shouldSkipClass

        public boolean shouldSkipClass​(java.lang.Class<?> clazz)
        Determines whether the class implements a WebDriver interface and should be ignored.
        Specified by:
        shouldSkipClass in interface com.google.gson.ExclusionStrategy
        Parameters:
        clazz - the class object that is under test
        Returns:
        true if the class should be ignored; otherwise false
      • shouldSkipField

        public boolean shouldSkipField​(com.google.gson.FieldAttributes f)
        Determined whether a filed should be skipped. It has no effect in this exclusion strategy as there is no need for it. Note: It is not used / implemented in this strategy as it is redundant.
        Specified by:
        shouldSkipField in interface com.google.gson.ExclusionStrategy
        Parameters:
        f - the field object that is under test
        Returns:
        true if the field should be ignored; otherwise false