logahawk.formatters
Class SwingParentArgFormatter
java.lang.Object
logahawk.formatters.AbstractArgumentFormatter
logahawk.formatters.ParentObjectArgFormatter
logahawk.formatters.SwingParentArgFormatter
- All Implemented Interfaces:
- ArgumentFormatter
public class SwingParentArgFormatter
- extends ParentObjectArgFormatter
Uses a SwingArgFormatter to format AWT/Swing objects to show its context within its parent AWT/Swing
objects.
This should not be added in an ArgumentFormatterContainer with a SwingArgFormatter because both
classes have the same implementation of ParentObjectArgFormatter.canFormat(Object). (That means calls to AbstractArgumentFormatter.getChildObjectFormat(Object, Collection, int) from this class, which the default of implementation of ParentObjectArgFormatter uses, will be unable to distinguish which class should be used to format the objects.)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SwingParentArgFormatter
public SwingParentArgFormatter()
- Defaults the
CollectionArgFormatter to using "->" for the separator, "[ " and " ]" for the prefix and
suffix.
SwingParentArgFormatter
public SwingParentArgFormatter(CollectionArgFormatter collectionArgFormatter)
- Parameters:
collectionArgFormatter - Used to formats the final result after formatting the logged object and parents.
SwingParentArgFormatter
public SwingParentArgFormatter(ArgumentFormatter formatter,
CollectionArgFormatter collectionArgFormatter)
- Parameters:
formatter - Used to format the child and parent Swing objects.collectionArgFormatter - Used to formats the final result after formatting the logged object and parents.
getParent
protected Object getParent(Object obj)
- Description copied from class:
ParentObjectArgFormatter
- Returns the parent of the provided object. If there is no parent, this should return null.
- Specified by:
getParent in class ParentObjectArgFormatter
- Parameters:
obj - Either the original object or another parent.