Package spoon.support.sniper.internal
Class DefaultSourceFragmentPrinter
java.lang.Object
spoon.support.sniper.internal.DefaultSourceFragmentPrinter
- All Implemented Interfaces:
SourceFragmentPrinter
A default dumb implementation of
SourceFragmentPrinter
, which only prints the given PrinterEvent.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
knowsHowToPrint(PrinterEvent event)
void
Called when printing using this context is going to finishvoid
onPush()
called when pushed on the stackvoid
print(PrinterEvent event)
Called whenDefaultJavaPrettyPrinter
starts an operationint
update(PrinterEvent event)
Update the internal state of this printer for this event but does not print anything.
-
Field Details
-
INSTANCE
-
-
Method Details
-
onPush
public void onPush()Description copied from interface:SourceFragmentPrinter
called when pushed on the stack- Specified by:
onPush
in interfaceSourceFragmentPrinter
-
print
Description copied from interface:SourceFragmentPrinter
Called whenDefaultJavaPrettyPrinter
starts an operation- Specified by:
print
in interfaceSourceFragmentPrinter
- Parameters:
event
- theDefaultJavaPrettyPrinter
event
-
update
Description copied from interface:SourceFragmentPrinter
Update the internal state of this printer for this event but does not print anything. Returns the index of the fragment corresponding to this event.- Specified by:
update
in interfaceSourceFragmentPrinter
-
onFinished
public void onFinished()Description copied from interface:SourceFragmentPrinter
Called when printing using this context is going to finish- Specified by:
onFinished
in interfaceSourceFragmentPrinter
-
knowsHowToPrint
- Specified by:
knowsHowToPrint
in interfaceSourceFragmentPrinter
- Returns:
- true if this printer is able to handle this event
That is that we can safely call
SourceFragmentPrinter.print(PrinterEvent)
after having called this one.
-