Search in sources :

Example 1 with TextSpecificBuilderAdapter

use of org.whole.lang.text.builders.TextSpecificBuilderAdapter in project whole by wholeplatform.

the class TextLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new TextGenericBuilderAdapter((ITextBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(TextLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new TextSpecificBuilderAdapter(strategy, entityContext);
        }
    });
    platform.addOperationFactory(TextLanguageKit.URI, InterpreterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new TextInterpreterVisitor((InterpreterOperation) operation);
            else
                return null;
        }
    });
    platform.addOperationFactory(TextLanguageKit.URI, PrettyPrinterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new TextPrettyPrinterVisitor((PrettyPrinterOperation) operation);
        }
    });
    platform.addPersistenceKit("org.whole.lang.text.TextSourceEditor", TextSourcePersistenceKit.instance());
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) ITextBuilder(org.whole.lang.text.builders.ITextBuilder) IOperation(org.whole.lang.operations.IOperation) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) TextPrettyPrinterVisitor(org.whole.lang.text.visitors.TextPrettyPrinterVisitor) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) TextInterpreterVisitor(org.whole.lang.text.visitors.TextInterpreterVisitor) TextGenericBuilderAdapter(org.whole.lang.text.builders.TextGenericBuilderAdapter) TextSpecificBuilderAdapter(org.whole.lang.text.builders.TextSpecificBuilderAdapter)

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 ITextBuilder (org.whole.lang.text.builders.ITextBuilder)1 TextGenericBuilderAdapter (org.whole.lang.text.builders.TextGenericBuilderAdapter)1 TextSpecificBuilderAdapter (org.whole.lang.text.builders.TextSpecificBuilderAdapter)1 TextInterpreterVisitor (org.whole.lang.text.visitors.TextInterpreterVisitor)1 TextPrettyPrinterVisitor (org.whole.lang.text.visitors.TextPrettyPrinterVisitor)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1