Package com.netflix.infix.lang.infix.antlr

Source Code of com.netflix.infix.lang.infix.antlr.NullTreeNode

package com.netflix.infix.lang.infix.antlr;

import com.google.common.base.Predicate;
import com.netflix.infix.NullValuePredicate;
import com.netflix.infix.PathValueEventFilter;

import org.antlr.runtime.Token;
import org.antlr.runtime.tree.Tree;

import static com.netflix.infix.lang.infix.antlr.TreeNodeUtil.getXPath;

public class NullTreeNode extends PredicateBaseTreeNode implements PredicateTranslatable {

  @Override
  public Predicate<Object> translate() {
    String xpath = getXPath(getChild(0));
   
    return new PathValueEventFilter(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.infix.lang.infix.antlr.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.