org.evento.parser.model.handler.QueryHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of evento-parser Show documentation
Show all versions of evento-parser Show documentation
Codebase Parser to detect RECQ Components for Evento Framework
package org.evento.parser.model.handler;
import org.evento.parser.model.payload.Query;
import java.util.HashMap;
import java.util.Map;
/**
* The QueryHandler class represents a handler for Query payloads.
* It extends the Handler class and implements the HasQueryInvocations interface.
*/
public class QueryHandler extends Handler implements HasQueryInvocations {
private HashMap invokedQueries = new HashMap<>();
/**
* Constructs a new QueryHandler object with the specified payload and line number.
*
* @param payload The Query object representing the query payload.
* @param line The line number where the query handler is invoked.
*/
public QueryHandler(Query payload, int line) {
super(payload, line);
}
/**
* Constructs a new QueryHandler object.
*/
public QueryHandler() {
}
@Override
public void addQueryInvocation(Query query, int line) {
invokedQueries.put(line, query);
}
@Override
public Map getQueryInvocations() {
return invokedQueries;
}
/**
* Retrieves a map of invoked queries.
*
* @return A HashMap with Integer as the key representing the line number of the invocation,
* and Query as the value representing the invoked query.
*/
public HashMap getInvokedQueries() {
return invokedQueries;
}
/**
* Sets the map of invoked queries.
*
* @param invokedQueries The map containing the invoked queries where the key is the line number of the invocation and the value is the Query object representing the invoked query
*.
*/
public void setInvokedQueries(HashMap invokedQueries) {
this.invokedQueries = invokedQueries;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy