Package org.rythmengine.internal

Examples of org.rythmengine.internal.IDialect


        return cur.get().peek();
    }

    private static IDialect pop() {
        Stack<IDialect> sd = cur.get();
        IDialect d = sd.pop();
        if (sd.isEmpty()) {
            cur.remove();
        }
        return d;
    }
View Full Code Here


        return d;
    }

    public void beginParse(IContext ctx) {
        CodeBuilder cb = ctx.getCodeBuilder();
        IDialect d = cb.requiredDialect;
        if (null == d) {
            d = ctx.getDialect();
            if (null != d) {
                // try the next available
                d = nextAvailable(d);
                if (null == d) throw new NullPointerException("No dialect can process the template");
            } else {
                // guess the most capable
                String template = ctx.getRemain();
                for (IDialect d0 : defDialects) {
                    if (d0.isMyTemplate(template)) {
                        d = d0;
                        break;
                    }
                }
            }
        }
        ctx.setDialect(d);
        push(d);
        d.begin(ctx);
    }
View Full Code Here

        push(d);
        d.begin(ctx);
    }

    public void endParse(IContext ctx) {
        IDialect d = ctx.getDialect();
        d.end(ctx);
        pop();
    }
View Full Code Here

        if (null == dialectId) {
            for (IDialect d : defDialects) {
                registerParserFactories(d, factories);
            }
        } else {
            IDialect d = getById(dialectId);
            if (null != d) {
                registerParserFactories(d, factories);
            } else {
                throw new IllegalArgumentException("Cannot find dialect by Id: " + dialectId);
            }
View Full Code Here

TOP

Related Classes of org.rythmengine.internal.IDialect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.