blob: c45823da19af3c44748289b0d55ce02c926f6d32 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.yolean.trace;
/**
* <p>This class is an abstract visitor of {@link TraceNode}. See {@link TraceNode#accept(TraceVisitor)}.</p>
*
* @author bratseth
* @since 5.1.15
*/
public abstract class TraceVisitor {
/**
* <p>Visits a {@link TraceNode}. Called by {@link TraceNode#accept(TraceVisitor)}, before visiting its
* children.</p>
*
* @param node the <tt>TraceNode</tt> being visited
* @see TraceNode#accept(TraceVisitor)
*/
public abstract void visit(TraceNode node);
/**
* <p>Enters a {@link TraceNode}. This method is called after {@link #visit(TraceNode)}, but before visiting its
* children. Note that this method is NOT called if a <tt>TraceNode</tt> has zero children.</p>
* <p>The default implementation of this method does nothing.</p>
*
* @param node the <tt>TraceNode</tt> being entered
* @see #leaving(TraceNode)
*/
@SuppressWarnings("UnusedParameters")
public void entering(TraceNode node) {
// empty
}
/**
* <p>Leaves a {@link TraceNode}. This method is called after {@link #entering(TraceNode)}, and after visiting its
* children. Note that this method is NOT called if a <tt>TraceNode</tt> has zero children.</p>
* <p>The default implementation of this method does nothing.</p>
*
* @param node the <tt>TraceNode</tt> being left
*/
@SuppressWarnings("UnusedParameters")
public void leaving(TraceNode node) {
// empty
}
}
|