All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.perplexhub.rsql.RSQLSimpleConverter Maven / Gradle / Ivy

There is a newer version: 6.0.23
Show newest version
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