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

org.molgenis.data.rest.convert.AggregateQueryRsqlConverter Maven / Gradle / Ivy

There is a newer version: 7.4.9
Show newest version
package org.molgenis.data.rest.convert;

import static com.google.common.base.Preconditions.checkNotNull;

import org.molgenis.data.rsql.AggregateQueryRsql;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;

import cz.jirutka.rsql.parser.RSQLParser;
import cz.jirutka.rsql.parser.ast.Node;

public class AggregateQueryRsqlConverter implements Converter
{
	private final RSQLParser rsqlParser;

	@Autowired
	public AggregateQueryRsqlConverter(RSQLParser rsqlParser)
	{
		this.rsqlParser = checkNotNull(rsqlParser);
	}

	@Override
	public AggregateQueryRsql convert(String source)
	{
		Node rootNode = rsqlParser.parse(source);
		return new AggregateQueryRsql(rootNode);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy