io.github.perplexhub.rsql.RSQLSimpleConverter Maven / Gradle / Ivy
package io.github.perplexhub.rsql;
import java.util.Collections;
import java.util.Map;
import org.springframework.util.MultiValueMap;
import cz.jirutka.rsql.parser.ast.AndNode;
import cz.jirutka.rsql.parser.ast.ComparisonNode;
import cz.jirutka.rsql.parser.ast.OrNode;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class RSQLSimpleConverter extends RSQLVisitorBase> {
public RSQLSimpleConverter() {
super();
}
@Override
public Void visit(ComparisonNode node, MultiValueMap map) {
log.debug("visit(node:{},map:{})", node, map);
map.addAll(node.getSelector(), node.getArguments());
return null;
}
@Override
public Void visit(AndNode node, MultiValueMap map) {
log.debug("visit(node:{},map:{})", node, map);
node.getChildren().forEach(n -> n.accept(this, map));
return null;
}
@Override
public Void visit(OrNode node, MultiValueMap map) {
log.debug("visit(node:{},map:{})", node, map);
node.getChildren().forEach(n -> n.accept(this, map));
return null;
}
@Override
public Map getPropertyPathMapper() {
return Collections.emptyMap();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy