aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/content/DocumentTypeVisitor.java
blob: 7e839f230b770c0a1936841c634678c601ca291e (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.content;

import com.yahoo.document.select.Visitor;
import com.yahoo.document.select.rule.ArithmeticNode;
import com.yahoo.document.select.rule.AttributeNode;
import com.yahoo.document.select.rule.ComparisonNode;
import com.yahoo.document.select.rule.EmbracedNode;
import com.yahoo.document.select.rule.IdNode;
import com.yahoo.document.select.rule.LiteralNode;
import com.yahoo.document.select.rule.LogicNode;
import com.yahoo.document.select.rule.NegationNode;
import com.yahoo.document.select.rule.NowNode;
import com.yahoo.document.select.rule.VariableNode;

public abstract class DocumentTypeVisitor implements Visitor {

    @Override
    public void visit(ArithmeticNode arithmeticNode) {
        for (ArithmeticNode.NodeItem item : arithmeticNode.getItems()) {
            item.getNode().accept(this);
        }
    }

    @Override
    public void visit(AttributeNode attributeNode) {
        attributeNode.getValue().accept(this);
    }

    @Override
    public void visit(ComparisonNode comparisonNode) {
        comparisonNode.getLHS().accept(this);
        comparisonNode.getRHS().accept(this);
    }

    @Override
    public void visit(EmbracedNode embracedNode) {
        embracedNode.getNode().accept(this);
    }

    @Override
    public void visit(IdNode idNode) {
    }

    @Override
    public void visit(LiteralNode literalNode) {
    }

    @Override
    public void visit(LogicNode logicNode) {
        for (LogicNode.NodeItem item : logicNode.getItems()) {
            item.getNode().accept(this);
        }
    }

    @Override
    public void visit(NegationNode negationNode) {
        negationNode.getNode().accept(this);
    }

    @Override
    public void visit(NowNode nowNode) {
    }

    @Override
    public void visit(VariableNode variableNode) {
    }

}