net.intelie.pipes.AstFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pipes-api Show documentation
Show all versions of pipes-api Show documentation
Intelie Pipes' API classes and interfaces
package net.intelie.pipes;
import net.intelie.pipes.ast.AstNode;
public abstract class AstFunction implements Function {
private static final long serialVersionUID = 1L;
private final String name;
public AstFunction(String name) {
this.name = name;
}
public abstract AstNode getNode(ArgQueue queue);
@Override
public Object declare(ArgQueue queue) throws PipeException {
return queue.context().compile(getNode(queue)).result();
}
@Override
public String description() {
return name;
}
@Override
public String name() {
return name;
}
@Override
public HelpData help() {
return null;
}
public static class Constant extends AstFunction {
private final AstNode node;
public Constant(String name, AstNode node) {
super(name);
this.node = node;
}
@Override
public AstNode getNode(ArgQueue queue) {
return node;
}
}
}