Package spoon.reflect.visitor
Class ListPrinter
java.lang.Object
spoon.reflect.visitor.ListPrinter
- All Implemented Interfaces:
Closeable
,AutoCloseable
Helper which assures consistent printing of lists
prefixed with `start`, separated by `separator` and suffixed by `end`.
If there is no item in the list then it prints `start` and then `end`
If there is one item in the list then it prints `start`, item and then `end`
If there is more then one items in the list then it prints `start`, items separated by `separator` and then `end`
If there is no item in the list then it prints `start` and then `end`
If there is one item in the list then it prints `start`, item and then `end`
If there is more then one items in the list then it prints `start`, items separated by `separator` and then `end`
-
Constructor Summary
ConstructorsConstructorDescriptionListPrinter(TokenWriter printerHelper, boolean startPrefixSpace, String start, boolean startSuffixSpace, boolean nextPrefixSpace, String next, boolean nextSuffixSpace, boolean endPrefixSpace, String end)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
Call that before printing of list item starts
-
Constructor Details
-
ListPrinter
public ListPrinter(TokenWriter printerHelper, boolean startPrefixSpace, String start, boolean startSuffixSpace, boolean nextPrefixSpace, String next, boolean nextSuffixSpace, boolean endPrefixSpace, String end)
-
-
Method Details
-
printSeparatorIfAppropriate
public void printSeparatorIfAppropriate()Call that before printing of list item starts -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-