Package com.netflix.suro.routing.filter.lang

Source Code of com.netflix.suro.routing.filter.lang.NullTreeNode

package com.netflix.suro.routing.filter.lang;

import com.netflix.suro.routing.filter.NullValuePredicate;
import com.netflix.suro.routing.filter.PathValueMessageFilter;
import com.netflix.suro.routing.filter.MessageFilter;
import org.antlr.runtime.Token;
import org.antlr.runtime.tree.Tree;

import static com.netflix.suro.routing.filter.lang.TreeNodeUtil.getXPath;

public class NullTreeNode extends MessageFilterBaseTreeNode implements MessageFilterTranslatable {

  @Override
  public MessageFilter translate() {
    String xpath = getXPath(getChild(0));
   
    return new PathValueMessageFilter(xpath, NullValuePredicate.INSTANCE);
  }

  public NullTreeNode(Token t) {
    super(t);
  }

  public NullTreeNode(NullTreeNode node) {
    super(node);
  }

  public Tree dupNode() {
    return new NullTreeNode(this);
  }
}
TOP

Related Classes of com.netflix.suro.routing.filter.lang.NullTreeNode

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.