package hu.bme.mit.incquery.cep.casestudy.transaction.incquery.patterns.sample.util;
import hu.bme.mit.incquery.cep.casestudy.transaction.incquery.patterns.sample.ComponentCMatcher;
import org.eclipse.incquery.runtime.api.IncQueryEngine;
import org.eclipse.incquery.runtime.api.impl.BaseGeneratedQuerySpecification;
import org.eclipse.incquery.runtime.exception.IncQueryException;
import org.eclipse.incquery.runtime.extensibility.IQuerySpecificationProvider;
/**
* A pattern-specific query specification that can instantiate ComponentCMatcher in a type-safe way.
*
* @see ComponentCMatcher
* @see ComponentCMatch
*
*/
@SuppressWarnings("all")
public final class ComponentCQuerySpecification extends BaseGeneratedQuerySpecification<ComponentCMatcher> {
/**
* @return the singleton instance of the query specification
* @throws IncQueryException if the pattern definition could not be loaded
*
*/
public static ComponentCQuerySpecification instance() throws IncQueryException {
try {
return LazyHolder.INSTANCE;
} catch (ExceptionInInitializerError err) {
processInitializerError(err);
throw err;
}
}
@Override
protected ComponentCMatcher instantiate(final IncQueryEngine engine) throws IncQueryException {
return ComponentCMatcher.on(engine);
}
@Override
protected String getBundleName() {
return "hu.bme.mit.incquery.cep.casestudy.transaction.incquery.patterns";
}
@Override
protected String patternName() {
return "hu.bme.mit.incquery.cep.casestudy.transaction.incquery.patterns.sample.componentC";
}
private ComponentCQuerySpecification() throws IncQueryException {
super();
}
@SuppressWarnings("all")
public static class Provider implements IQuerySpecificationProvider<ComponentCQuerySpecification> {
@Override
public ComponentCQuerySpecification get() throws IncQueryException {
return instance();
}
}
@SuppressWarnings("all")
private static class LazyHolder {
private final static ComponentCQuerySpecification INSTANCE = make();
public static ComponentCQuerySpecification make() {
try {
return new ComponentCQuerySpecification();
} catch (IncQueryException ex) {
throw new RuntimeException (ex);
}
}
}
}