Package org.rythmengine.extension

Examples of org.rythmengine.extension.ICodeType


    public Token go() {
        IContext ctx = ctx();
        if (!ctx.insideDirectiveComment()) {
            return null;
        }
        ICodeType type = ctx.peekCodeType();
        while (null != type) {
            String s = type.commentEnd();
            if (!S.empty(s)) {
                s = S.escapeRegex(s).toString();
                s = "(\\s*" + s + ")" + ".*";
                Pattern p = patterns.get(s);
                if (null == p) {
                    p = Pattern.compile(s, Pattern.DOTALL);
                    patterns.put(s, p);
                }
                Matcher m = p.matcher(remain());
                if (m.matches()) {
                    s = m.group(1);
                    ctx.step(s.length());
                    ctx.leaveDirectiveComment();
                    return Token.EMPTY_TOKEN;
                }
            }
            type = type.getParent();
        }

        return null;
    }
View Full Code Here


                // it is removed?
                isValid = false;
                engine.classes().remove(this);
                return false;
            }
            ICodeType type = engine.renderSettings.codeType();
            if (null == type) {
                type = templateResource.codeType(engine());
            }
            if (null == type || ICodeType.DefImpl.RAW == type) {
                type = engine.conf().defaultCodeType();
View Full Code Here

    private static Map<String, Pattern> patterns = new HashMap<String, Pattern>();

    @Override
    public Token go() {
        IContext ctx = ctx();
        ICodeType curType = ctx.peekCodeType();
        if (!curType.allowInternalTypeBlock()) return null;

        String remain = ctx.getRemain();
        Iterable<ICodeType> types = ctx.getEngine().extensionManager().templateLangs();

        for (ICodeType type : types) {
View Full Code Here

TOP

Related Classes of org.rythmengine.extension.ICodeType

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.