| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlogahawk.formatters.AbstractArgumentFormatter
logahawk.formatters.ParentObjectArgFormatter
public abstract class ParentObjectArgFormatter
Formats the object and its parents allowing one to see an object's context in relation to other objects. The parent
 information will be printed before the the child. This does not actually handle formatting of the original object,
 that is passed on to the
 The phrase "parent" does mean to imply that only true parents need to be used, it simply needs to be an associated
 object that helps describe the original object's context.
 Note that this class does not use the passed in collection of ArgumentFormatters to format the child or
 parent objects, it requires those to be passed in as constructor arguments. This is done to avoid any sort of
 ambiguity where a regular ArgumentFormatter and a ParentObjectArgFormatter can format the same
 classes (according to their canFormat(Object), and the AbstractArgumentFormatter.getChildObjectFormat(Object, Collection,
 int) cannot correctly distinguish between the two.
| Field Summary | |
|---|---|
| protected  ArgumentFormatter | childFormatterFormats the child object. | 
| protected  CollectionArgFormatter | collectionArgFormatterFormats the parents objects. | 
| protected  ArgumentFormatter | parentFormatterFormats the parent objects. | 
| Fields inherited from class logahawk.formatters.AbstractArgumentFormatter | 
|---|
| indentor | 
| Constructor Summary | |
|---|---|
| protected  | ParentObjectArgFormatter(ArgumentFormatter childFormatter,
                         ArgumentFormatter parentFormatter,
                         CollectionArgFormatter collectionArgFormatter) | 
| Method Summary | |
|---|---|
|  boolean | canFormat(Object obj)Default implementations returns canFormat(Object)onchildFormatter. | 
|  String | format(Object obj,
       Collection<ArgumentFormatter> formatters,
       int indentLevel)This converts the object into a Stringthat represent the object. | 
| protected abstract  Object | getParent(Object obj)Returns the parent of the provided object. | 
| Methods inherited from class logahawk.formatters.AbstractArgumentFormatter | 
|---|
| findFormatter, getChildObjectFormat, getIndentor, setIndentor | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected final CollectionArgFormatter collectionArgFormatter
protected final ArgumentFormatter childFormatter
protected final ArgumentFormatter parentFormatter
ArgumentFormatter or it can be a simplified formatter just for this purpose. If is recommended to return just the
 basic information needed to identify the original object, perhaps a type and a name.
| Constructor Detail | 
|---|
protected ParentObjectArgFormatter(ArgumentFormatter childFormatter,
                                   ArgumentFormatter parentFormatter,
                                   CollectionArgFormatter collectionArgFormatter)
| Method Detail | 
|---|
public boolean canFormat(Object obj)
canFormat(Object) on childFormatter.
public String format(Object obj,
                     Collection<ArgumentFormatter> formatters,
                     int indentLevel)
ArgumentFormatterString that represent the object. The String may contain line
 breaks, but should not include a trailing line break. The first line of the result should NOT include any
 indentation, that should be handled by the calling class.
 If the object is complex and contains other objects, this ArgumentFormatter may use the provided list of
 ArgumentFormatter objects to find a more appropriate formatter.
 To make things look nice, the "indentLevel" is provided. The indent level should always be incremented by one when
 calling downward into other ArgumentFormatters.
protected abstract Object getParent(Object obj)
obj - Either the original object or another parent.| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||