• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PropertiesProxy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.nutz.ioc.impl.PropertiesProxy的典型用法代码示例。如果您正苦于以下问题:Java PropertiesProxy类的具体用法?Java PropertiesProxy怎么用?Java PropertiesProxy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PropertiesProxy类属于org.nutz.ioc.impl包,在下文中一共展示了PropertiesProxy类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTemplateShareVars

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
/**
 * 模板引擎共用的变量
 */

public static NutMap getTemplateShareVars() {
	NutMap share = new NutMap();
	Ioc ioc = Mvcs.getIoc();
	share.put("ioc", ioc);
	PropertiesProxy conf = ioc.get(PropertiesProxy.class, "conf");
	share.put("conf", conf.toMap());

	if (!conf.getBoolean("cdn.enable", false) || Strings.isBlank(conf.get("cdn.urlbase"))) {
		share.put("cdnbase", "");
	} else {
		share.put("cdnbase", conf.get("cdn.urlbase"));
	}
	return share;
}
 
开发者ID:strictnerd,项目名称:windows-file-change,代码行数:19,代码来源:Toolkit.java


示例2: setPath

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public void setPath(String path) {
	PropertiesProxy pp = new PropertiesProxy(path);
	Map<String, Object> map = new LinkedHashMap(pp.toMap());
	if (pp.get("openid") != null) {
		String appid = pp.get("openid");
		WxMaster def = Lang.map2Object(map, WxMaster.class);
		masters.put(appid, def);
		apis.put(appid, new WxApiImpl(def));
		handlers.put(appid, new BasicWxHandler(def.getToken()));
	}
	for (Entry<String, Object> en : map.entrySet()) {
		String key = en.getKey();
		if (key.endsWith(".openid")) {
			key = key.substring(0, key.indexOf('.'));
			Map<String, Object> tmp = filter(map, key + ".", null, null, null);
			String openid = tmp.get("openid").toString();
			WxMaster one = Lang.map2Object(tmp, WxMaster.class);
			masters.put(openid, one);
			apis.put(openid, new WxApiImpl(one));
			handlers.put(openid, new BasicWxHandler(one.getToken()));
		}
	}
}
 
开发者ID:amdiaosi,项目名称:nutzWx,代码行数:25,代码来源:WxContext.java


示例3: test_ioc_load

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
@Test
public void test_ioc_load() throws ClassNotFoundException {
    // 仿真一个配置文件
       PropertiesProxy conf = new PropertiesProxy();
       conf.put("weixin.atstore", "jedis"); // 测试jedisAgent存储AccessToken
       conf.put("weixin.token", "1234567890");
       conf.put("weixin.appid", "wx10927e35a365fe1c");
       conf.put("weixin.appsecret", "c29accd1784e636d6478eac9b6b3aYYY"); // YYY是假的
       conf.put("weixin.openid", "XXX");
       
       // 沙箱测试
    // http://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index
    NutIoc ioc = new NutIoc(new ComboIocLoader("*weixin", "*jedis"));
    ioc.getIocContext().save("app", "conf", new ObjectProxy(conf));
    
    WxApi2 wxApi2 = ioc.get(WxApi2.class);
    for (int i = 0; i < 6; i++) {
        wxApi2.get_industry();
       }
    ioc.depose();
}
 
开发者ID:nutzam,项目名称:nutzwx,代码行数:22,代码来源:WxsTest.java


示例4: start

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
public void start(){
    IWsMsgHandler accepter = getIoc().get(IWsMsgHandler.class, "accepter");
    PropertiesProxy conf = getIoc().get(PropertiesProxy.class, "conf");
    int port = 5210;
    port = Integer.valueOf( conf.get("tio.port"));
    try {
        WsServerStarter wsServerStarter = new WsServerStarter(port, accepter);
        groupContext= wsServerStarter.getServerGroupContext();
        wsServerStarter.start();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
开发者ID:TopCoderMyDream,项目名称:LuliChat,代码行数:14,代码来源:SocketServer.java


示例5: configure

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
public WxLoginImpl configure(PropertiesProxy conf, String prefix) {
    prefix = Strings.sBlank(prefix);
    appid = conf.get(prefix + "appid");
    appsecret = conf.get(prefix + "appsecret");
    host = conf.get(prefix + "host");
    return this;
}
 
开发者ID:nutzam,项目名称:nutzwx,代码行数:8,代码来源:WxLoginImpl.java


示例6: configure

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
public BasicWxHandler configure(PropertiesProxy conf, String prefix){
    prefix = Strings.sBlank(prefix);
    token = conf.check(prefix+"token");
    aeskey = conf.get(prefix+"aes");
    appid = conf.get(prefix+"appid");
    return this;
}
 
开发者ID:nutzam,项目名称:nutzwx,代码行数:8,代码来源:BasicWxHandler.java


示例7: configure

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
public WxApi2 configure(PropertiesProxy conf, String prefix) {
	prefix = Strings.sBlank(prefix);
	token = conf.check(prefix + "token");
	appid = conf.get(prefix + "appid");
	appsecret = conf.get(prefix + "appsecret");
	openid = conf.get(prefix + "openid");
	encodingAesKey = conf.get(prefix + "aes");
	return this;
}
 
开发者ID:nutzam,项目名称:nutzwx,代码行数:10,代码来源:AbstractWxApi2.java


示例8: _read_rss

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
private void _read_rss(PropertiesProxy pp) {
    String[] ss = Strings.splitIgnoreBlank(pp.get("zdoc-rs"), "[,\n]");
    for (String s : ss) {
        ZFile d = src.get(s);
        if (null != d) {
            topIgnores.add(s);
            rss.add(d);
        }
    }
}
 
开发者ID:zozoh,项目名称:zdoc,代码行数:11,代码来源:ZDocHome.java


示例9: _read_vars

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
private void _read_vars(PropertiesProxy pp) {
    String[] ss = Strings.splitIgnoreBlank(pp.get("zdoc-vars"), "\n");
    for (String s : ss) {
        int pos = s.indexOf('=');
        String varName = s.substring(0, pos).trim();
        String valValue = s.substring(pos + 1).trim();
        vars.set(varName, valValue);
    }
}
 
开发者ID:zozoh,项目名称:zdoc,代码行数:10,代码来源:ZDocHome.java


示例10: _read_rules

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
private void _read_rules(PropertiesProxy pp) {
    String[] ss = Strings.splitIgnoreBlank(pp.get("zdoc-rules"), "\n");
    for (String s : ss) {
        int pos = s.lastIndexOf(':');
        String regex = s.substring(0, pos).trim();
        String key = s.substring(pos + 1).trim();
        ZDocRule rule = new ZDocRule();
        rules.add(rule.key(key).regex(regex));
    }
}
 
开发者ID:zozoh,项目名称:zdoc,代码行数:11,代码来源:ZDocHome.java


示例11: switchTo

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
@Override
public void switchTo(ZDir home) {
    this.home = home;
    this.conf = new ZPageConfig();
    
    // 看看有木有特殊的配置信息
    ZFile zf = home.get("zpage.conf");
    if (null != zf) {
        PropertiesProxy pp = new PropertiesProxy(io.readString(zf));

        conf.tmpl(pp.trim("zpage-tmpl", conf.tmpl()));
        conf.libs(pp.trim("zpage-libs", conf.libs()));
        conf.rs(Strings.splitIgnoreBlank(pp.trim("zpage-rs", "imgs,js,css")));
        
        String rules = pp.get("zpage-rules", " .* : normal");
        String[] lines = Strings.splitIgnoreBlank(rules, "\n");
        List<ZPageRule> list = new ArrayList<ZPageRule>(lines.length);
        for (String line : lines) {
            int pos = line.lastIndexOf(':');
            ZPageRule rule = new ZPageRule(Strings.trim(line.substring(0,
                                                                       pos)),
                                           Strings.trim(line.substring(pos + 1)));
            list.add(rule);
        }

    }
}
 
开发者ID:zozoh,项目名称:zpage,代码行数:28,代码来源:ZPageFsApi.java


示例12: getProject

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
/**
 * @return the project
 */
public static PropertiesProxy getProject() {
	return project;
}
 
开发者ID:Kerbores,项目名称:Nutz-matic,代码行数:7,代码来源:Config.java


示例13: getTemplete

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
/**
 * @return the templete
 */
public static PropertiesProxy getTemplete() {
	return templete;
}
 
开发者ID:Kerbores,项目名称:Nutz-matic,代码行数:7,代码来源:Config.java


示例14: getTypeMapping

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
/**
 * @return the typeMapping
 */
public static PropertiesProxy getTypeMapping() {
	return typeMapping;
}
 
开发者ID:Kerbores,项目名称:Nutz-matic,代码行数:7,代码来源:Config.java


示例15: getTableMapping

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
/**
 * @return the tableMapping
 */
public static PropertiesProxy getTableMapping() {
	return tableMapping;
}
 
开发者ID:Kerbores,项目名称:Nutz-matic,代码行数:7,代码来源:Config.java


示例16: getTableFieldMapping

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
/**
 * @return the tableFieldMapping
 */
public static PropertiesProxy getTableFieldMapping() {
	return tableFieldMapping;
}
 
开发者ID:Kerbores,项目名称:Nutz-matic,代码行数:7,代码来源:Config.java


示例17: getOther

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
/**
 * @return the other
 */
public static PropertiesProxy getOther() {
	return other;
}
 
开发者ID:Kerbores,项目名称:Nutz-matic,代码行数:7,代码来源:Config.java


示例18: assertExist

import org.nutz.ioc.impl.PropertiesProxy; //导入依赖的package包/类
public void assertExist(PropertiesProxy pp, String key) {
    if (vfs.exist(pp.get(key)))
        return;
    throw Lang.makeThrow("[%s]  path not exist [%s]", key, pp.get(key));
}
 
开发者ID:nutzam,项目名称:zbuild,代码行数:6,代码来源:ZBuildRunner.java



注:本文中的org.nutz.ioc.impl.PropertiesProxy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LogWrapperBase类代码示例发布时间:2022-05-22
下一篇:
Java ClosureFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap