Search in sources :

Example 1 with SQLPrettyPrinterVisitor

use of org.whole.lang.sql.visitors.SQLPrettyPrinterVisitor in project whole by wholeplatform.

the class SQLLanguageDeployer method deploy.

public void deploy(ReflectionFactory platform) {
    platform.addLanguageKit(new SQLLanguageKit());
    platform.addOperationFactory(SQLLanguageKit.URI, GenericBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new SQLGenericBuilderAdapter((ISQLBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(SQLLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new SQLSpecificBuilderAdapter(strategy, entityContext);
        }
    });
    platform.addOperationFactory(SQLLanguageKit.URI, PrettyPrinterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new SQLPrettyPrinterVisitor((PrettyPrinterOperation) operation);
        }
    });
    platform.addOperationFactory(SQLLanguageKit.URI, InterpreterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new SQLInterpreterVisitor();
            else
                return null;
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) SQLInterpreterVisitor(org.whole.lang.sql.visitors.SQLInterpreterVisitor) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) SQLSpecificBuilderAdapter(org.whole.lang.sql.builders.SQLSpecificBuilderAdapter) SQLPrettyPrinterVisitor(org.whole.lang.sql.visitors.SQLPrettyPrinterVisitor) ISQLBuilder(org.whole.lang.sql.builders.ISQLBuilder) SQLGenericBuilderAdapter(org.whole.lang.sql.builders.SQLGenericBuilderAdapter)

Aggregations

IBuilder (org.whole.lang.builders.IBuilder)1 IBuilderFactory (org.whole.lang.builders.IBuilderFactory)1 IEntityContext (org.whole.lang.contexts.IEntityContext)1 IOperation (org.whole.lang.operations.IOperation)1 PrettyPrinterOperation (org.whole.lang.operations.PrettyPrinterOperation)1 ISQLBuilder (org.whole.lang.sql.builders.ISQLBuilder)1 SQLGenericBuilderAdapter (org.whole.lang.sql.builders.SQLGenericBuilderAdapter)1 SQLSpecificBuilderAdapter (org.whole.lang.sql.builders.SQLSpecificBuilderAdapter)1 SQLInterpreterVisitor (org.whole.lang.sql.visitors.SQLInterpreterVisitor)1 SQLPrettyPrinterVisitor (org.whole.lang.sql.visitors.SQLPrettyPrinterVisitor)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1