Class ResourceSizeOfFilter

  • All Implemented Interfaces:
    SizeOfFilter

    public class ResourceSizeOfFilter
    extends java.lang.Object
    implements SizeOfFilter
    Filters based on a configuration file
    Author:
    Chris Dennis
    • Constructor Summary

      Constructors 
      Constructor Description
      ResourceSizeOfFilter​(java.net.URL filterData)
      Builds a filter based on the provided configuration URL
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean filterClass​(java.lang.Class<?> klazz)
      Checks whether the type needs to be filtered
      java.util.Collection<java.lang.reflect.Field> filterFields​(java.lang.Class<?> klazz, java.util.Collection<java.lang.reflect.Field> fields)
      Returns the fields to walk and measure for a type
      • Methods inherited from class java.lang.Object

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

      • ResourceSizeOfFilter

        public ResourceSizeOfFilter​(java.net.URL filterData)
                             throws java.io.IOException
        Builds a filter based on the provided configuration URL
        Parameters:
        filterData - the URL of the configuration
        Throws:
        java.io.IOException - if it couldn't read the configuration from the URL
    • Method Detail

      • filterFields

        public java.util.Collection<java.lang.reflect.Field> filterFields​(java.lang.Class<?> klazz,
                                                                          java.util.Collection<java.lang.reflect.Field> fields)
        Returns the fields to walk and measure for a type
        Specified by:
        filterFields in interface SizeOfFilter
        Parameters:
        klazz - the type
        fields - the fields already "qualified"
        Returns:
        the filtered Set
      • filterClass

        public boolean filterClass​(java.lang.Class<?> klazz)
        Checks whether the type needs to be filtered
        Specified by:
        filterClass in interface SizeOfFilter
        Parameters:
        klazz - the type
        Returns:
        true, if to be filtered out