public abstract class AbstractFilter extends java.lang.Object implements ProfilingFilter
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Class,java.util.Set<java.lang.String>> |
classes
A Map from a Class to filter to a set of values associated with the class.
|
protected static org.apache.log4j.Logger |
LOGGER
Used for logging.
|
protected java.util.Set<java.lang.Object> |
objects
A set of objects given to the filter
|
protected java.util.Set<java.lang.String> |
packages
The set of packages names being used by the filter
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractFilter()
Build a basic filter
|
protected |
AbstractFilter(java.io.File configFile)
Build a filter from a file.
|
protected |
AbstractFilter(java.lang.String configFile)
Build a filter from a file.
|
Modifier and Type | Method and Description |
---|---|
void |
addClass(java.lang.Class clazz)
Adds a class to the filter
|
void |
addField(java.lang.Class clazz,
java.lang.String fieldName)
Adds a field to the filter.
|
void |
addObject(java.lang.Object object)
Adds an object to the set of objects used by this filter
|
void |
addPackage(java.lang.String pack)
Adds a package to the filter
|
java.util.Map<java.lang.Class,java.util.Set<java.lang.String>> |
getClassesCopy()
Returns a copy of the classes used by this filter
|
protected java.lang.Class |
getMainClass(java.lang.Class clazz)
Strips off all the array tags to find out the type of the object
|
java.util.Set<java.lang.Object> |
getObjectsCopy()
Returns a shallow copy of the objects used by this filter
|
java.util.Set<java.lang.String> |
getPackagesCopy()
Returns a copy of the packages used by this filter
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
duplicateFilter, shouldVisitChild
protected static final org.apache.log4j.Logger LOGGER
protected java.util.Set<java.lang.String> packages
protected java.util.Map<java.lang.Class,java.util.Set<java.lang.String>> classes
protected java.util.Set<java.lang.Object> objects
protected AbstractFilter()
protected AbstractFilter(@NotNull java.lang.String configFile) throws java.io.IOException
configFile
- The file containing the filter informationjava.io.IOException
- On error reading from the fileprotected AbstractFilter(@NotNull java.io.File configFile) throws java.io.IOException
configFile
- The file containing the filter informationjava.io.IOException
- On error reading from the filepublic void addObject(java.lang.Object object)
object
- The object to add to the filterpublic void addField(java.lang.Class clazz, @Nullable java.lang.String fieldName)
clazz
- The class to add a field value tofieldName
- The name of the field to addpublic void addPackage(@Nullable java.lang.String pack)
pack
- The name of the package to add, as xx.xxx.xxxpublic void addClass(@Nullable java.lang.Class clazz)
clazz
- The class to add@NotNull public java.util.Map<java.lang.Class,java.util.Set<java.lang.String>> getClassesCopy()
@NotNull public java.util.Set<java.lang.Object> getObjectsCopy()
@NotNull public java.util.Set<java.lang.String> getPackagesCopy()
@NotNull protected java.lang.Class getMainClass(@NotNull java.lang.Class clazz)
clazz
- The class in question@NotNull public java.lang.String toString()
toString
in class java.lang.Object