Package org.rythmengine.conf

Examples of org.rythmengine.conf.RythmConfiguration


        if (null != conf) rawConf.putAll((Map) _processConf(conf));

        _initLogger(rawConf);

        // initialize the configuration with all loaded data
        RythmConfiguration rc = new RythmConfiguration(rawConf, this);
        this._conf = rc;

        // initialize logger factory
        ILoggerFactory logFact = rc.get(RythmConfigurationKey.LOG_FACTORY_IMPL);
        Logger.registerLoggerFactory(logFact);

        // check if it needs to debug the conf information
        if (rawConf.containsKey("rythm.debug_conf") && Boolean.parseBoolean(rawConf.get("rythm.debug_conf").toString())) {
            rc.debug();
        }
    }
View Full Code Here


        tmpBlackList.remove();
    }

    public TemplateResourceManager(RythmEngine engine) {
        this.engine = engine;
        RythmConfiguration conf = engine.conf();
        typeInference = conf.typeInferenceEnabled();
        loaders = new ArrayList(conf.getList(RythmConfigurationKey.RESOURCE_LOADER_IMPLS, ITemplateResourceLoader.class));
        if (!loaders.isEmpty()) {
            Boolean defLoader = conf.get(RythmConfigurationKey.RESOURCE_DEF_LOADER_ENABLED);
            if (!defLoader) {
                return;
            }
        }
        List<File> roots = conf.templateHome();
        for (File root : roots) {
            FileResourceLoader frl = new FileResourceLoader(engine, root);
            if (null == adhocFileLoader) {
                adhocFileLoader = frl;
            }
View Full Code Here

                    iterator = Collections.EMPTY_LIST.iterator();
                    return;
                }
                List<String> seps = new ArrayList<String>();
                RythmEngine engine = RythmEngine.get();
                RythmConfiguration conf = engine.conf();
                if ("zh".equals(conf.locale().getLanguage())) {
                    seps.addAll(Arrays.asList("\n,、,,,;,。,:".split(",")));
                } else {
                    seps.add("\n");
                }
                seps.addAll(Arrays.asList(";^,^:^_^-".split("\\^")));
View Full Code Here

    private int lastCursor = 0;

    public TemplateTokenizer(IContext context) {
        ctx = context;
        RythmEngine engine = ctx.getEngine();
        RythmConfiguration conf = engine.conf();
        if ((conf.smartEscapeEnabled() || conf.naturalTemplateEnabled()) && engine.extensionManager().hasTemplateLangs()) {
            parsers.add(new CodeTypeBlockStartSensor(ctx));
            parsers.add(new CodeTypeBlockEndSensor(ctx));
        }
        if (conf.naturalTemplateEnabled() && engine.extensionManager().hasTemplateLangs()) {
            parsers.add(new DirectiveCommentStartSensor(ctx));
            parsers.add(new DirectiveCommentEndSensor(ctx));
        }
        parsers.add(new ParserDispatcher(ctx));
        parsers.add(new BlockCloseParser(ctx));
View Full Code Here

        line = -1;
        this.disableCompactMode = disableCompactMode;
        //TODO: dangerous engine assignment here. only called by AppendXXToken in AutoToStringCodeBuilder
        this.engine = Rythm.engine();
        this.javaExtensions = engine.extensionManager().javaExtensions();
        RythmConfiguration conf = engine.conf();
        this.transformEnabled = conf.transformEnabled();
    }
View Full Code Here

        ctx = context;
        line = (null == context) ? -1 : context.currentLine();
        this.engine = null == ctx ? Rythm.engine() : ctx.getEngine();
        this.javaExtensions = engine.extensionManager().javaExtensions();
        this.disableCompactMode = disableCompactMode;
        RythmConfiguration conf = engine.conf();
        this.transformEnabled = conf.transformEnabled();
    }
View Full Code Here

        renderListener.listeners.remove(l);
    }

    public EventBus(RythmEngine engine) {
        this.engine = engine;
        RythmConfiguration conf = engine.conf();
        sourceCodeEnhancer = conf.get(RythmConfigurationKey.CODEGEN_SOURCE_CODE_ENHANCER);
        //byteCodeEnhancer = conf.get(RythmConfigurationKey.CODEGEN_BYTE_CODE_ENHANCER);
        exceptionHandler = conf.get(RythmConfigurationKey.RENDER_EXCEPTION_HANDLER);
        IRythmListener l = conf.get(RythmConfigurationKey.RENDER_LISTENER);
        if (null != l) {
            registerRenderListener(l);
        }
        registerHandlers();
    }
View Full Code Here

    String cacheFileName(TemplateClass tc, String suffix) {
        return tc.name0() + suffix;
    }

    private File getCacheFile(String fileName) {
        RythmConfiguration conf = engine.conf();
        if (conf.loadPrecompiled() || conf.precompileMode()) {
            File precompileDir = conf.get(RythmConfigurationKey.HOME_PRECOMPILED);
            return new File(precompileDir, fileName);
        } else {
            File f = new File(conf.tmpDir(), fileName);
            return f;
        }
    }
View Full Code Here

    private interface IFilePathValidator {
        boolean isValid(String path);
    }
   
    private static boolean allowTmpDirIO(String path) {
        RythmConfiguration conf = RythmEngine.get().conf();
        if (conf.sandboxTmpIO()) {
            String tmp = System.getProperty("java.io.tmpdir");
            if (path.startsWith(tmp)) {
                return true;
            } else if ((path + File.separator).startsWith(tmp)) {
                return true;
View Full Code Here

TOP

Related Classes of org.rythmengine.conf.RythmConfiguration

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.