| 39 | import org.jetbrains.annotations.TestOnly; |
| 40 | |
| 41 | public abstract class BasePlanSink implements PlanSink { |
| 42 | |
| 43 | protected final ObjStack<RecordCursorFactory> factoryStack; |
| 44 | protected final HtmlEscapingStringSink htmlSink; |
| 45 | protected final EscapingStringSink textSink; |
| 46 | protected int depth; |
| 47 | protected SqlExecutionContext executionContext; |
| 48 | protected RecordMetadata metadata; |
| 49 | protected int order; |
| 50 | protected EscapingStringSink sink; |
| 51 | protected boolean useBaseMetadata; |
| 52 | |
| 53 | public BasePlanSink() { |
| 54 | this.htmlSink = new HtmlEscapingStringSink(); |
| 55 | this.textSink = new EscapingStringSink(); |
| 56 | this.sink = textSink; |
| 57 | this.depth = 0; |
| 58 | this.factoryStack = new ObjStack<>(); |
| 59 | this.order = -1; |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public PlanSink child(Plannable p, int order) { |
| 64 | this.order = order; |
| 65 | child(p); |
| 66 | this.order = -1; |
| 67 | |
| 68 | return this; |
| 69 | } |
| 70 | |
| 71 | @Override |
| 72 | public void clear() { |
| 73 | this.sink.clear(); |
| 74 | this.depth = 0; |
| 75 | this.factoryStack.clear(); |
| 76 | this.executionContext = null; |
| 77 | this.order = -1; |
| 78 | } |
| 79 | |
| 80 | @Override |
| 81 | public SqlExecutionContext getExecutionContext() { |
| 82 | return executionContext; |
| 83 | } |
| 84 | |
| 85 | @Override |
| 86 | public int getOrder() { |
| 87 | return order; |
| 88 | } |
| 89 | |
| 90 | @TestOnly |
| 91 | public StringSink getSink() { |
| 92 | return sink; |
| 93 | } |
| 94 | |
| 95 | @Override |
| 96 | public boolean getUseBaseMetadata() { |
| 97 | return useBaseMetadata; |
| 98 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…