当前位置: 首页>>代码示例>>Java>>正文


Java Configs类代码示例

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


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

示例1: indexThenNested

import com.addthis.codec.config.Configs; //导入依赖的package包/类
@Test
public void indexThenNested() throws Exception {
    Bundle bundle = makeListBundleWithOrder();
    AutoField writeField = Configs.decodeObject(AutoField.class, "auto = c.sub-field");
    writeField.setValue(bundle, ValueFactory.create("sub-value"));
    AutoField field = Configs.decodeObject(AutoField.class, "index = 2/sub-field");
    assertEquals("sub-value", field.getValue(bundle).asNative());
}
 
开发者ID:addthis,项目名称:bundle,代码行数:9,代码来源:IndexFieldTest.java

示例2: setEmptyMap

import com.addthis.codec.config.Configs; //导入依赖的package包/类
@Test
public void setEmptyMap() throws Exception {
    SimpleCopyFilter filter = Configs.decodeObject(SimpleCopyFilter.class, "from.const: {}, to: some-field");
    Bundle b = new ListBundle();
    filter.filter(b);
    assertEquals(Configs.newDefault(ValueMap.class), AutoField.newAutoField("some-field").getValue(b));
}
 
开发者ID:addthis,项目名称:bundle,代码行数:8,代码来源:ConstantFieldTest.java

示例3: setKeyFromValue

import com.addthis.codec.config.Configs; //导入依赖的package包/类
@Test
public void setKeyFromValue() throws Exception {
    SimpleCopyFilter filter = Configs.decodeObject(SimpleCopyFilter.class, "from.const: foobar, to: MAP/mykey");
    Bundle b = new ListBundle();
    ValueMap map = ValueFactory.createMap();
    b.setValue(b.getFormat().getField("MAP"), map);
    b.setValue(b.getFormat().getField("MYFIELD"), ValueFactory.create("blah"));
    filter.filter(b);
    assertEquals("foobar", map.get("mykey").asNative());
}
 
开发者ID:addthis,项目名称:bundle,代码行数:11,代码来源:ConstantFieldTest.java

示例4: replaceKeyFromValue

import com.addthis.codec.config.Configs; //导入依赖的package包/类
@Test
public void replaceKeyFromValue() throws Exception {
    SimpleCopyFilter filter = Configs.decodeObject(SimpleCopyFilter.class, "from.const:foobar, to:MAP.mykey");
    Bundle b = new ListBundle();
    ValueMap map = ValueFactory.createMap();
    map.put("mykey",ValueFactory.create("abc"));
    b.setValue(b.getFormat().getField("MAP"), map);
    b.setValue(b.getFormat().getField("MYFIELD"), ValueFactory.create("blah"));
    filter.filter(b);
    assertEquals("foobar", map.get("mykey").asNative());
}
 
开发者ID:addthis,项目名称:bundle,代码行数:12,代码来源:ConstantFieldTest.java

示例5: setKey

import com.addthis.codec.config.Configs; //导入依赖的package包/类
@Test
public void setKey() throws Exception {
    SimpleCopyFilter filter = Configs.decodeObject(SimpleCopyFilter.class, "from: MYFIELD, to: MAP.mykey");
    Bundle b = new ListBundle();
    ValueMap map = ValueFactory.createMap();
    b.setValue(b.getFormat().getField("MAP"), map);
    b.setValue(b.getFormat().getField("MYFIELD"), ValueFactory.create("foobar"));
    filter.filter(b);
    assertEquals("foobar", map.get("mykey").asNative());
}
 
开发者ID:addthis,项目名称:bundle,代码行数:11,代码来源:FullAutoFieldTest.java

示例6: replaceKey

import com.addthis.codec.config.Configs; //导入依赖的package包/类
@Test
public void replaceKey() throws Exception {
    SimpleCopyFilter filter = Configs.decodeObject(SimpleCopyFilter.class, "from: MYFIELD, to: MAP.mykey");
    Bundle b = new ListBundle();
    ValueMap map = ValueFactory.createMap();
    map.put("mykey",ValueFactory.create("abc"));
    b.setValue(b.getFormat().getField("MAP"), map);
    b.setValue(b.getFormat().getField("MYFIELD"), ValueFactory.create("foobar"));
    filter.filter(b);
    assertEquals("foobar", map.get("mykey").asNative());
}
 
开发者ID:addthis,项目名称:bundle,代码行数:12,代码来源:FullAutoFieldTest.java

示例7: notMap

import com.addthis.codec.config.Configs; //导入依赖的package包/类
@Test(expected = Exception.class)
public void notMap() throws Exception {
    SimpleCopyFilter filter = Configs.decodeObject(SimpleCopyFilter.class, "from: MYFIELD, to:MAP.mykey");
    Bundle b = new ListBundle();
    b.setValue(b.getFormat().getField("MYFIELD"), ValueFactory.create("blah"));
    filter.filter(b);
}
 
开发者ID:addthis,项目名称:bundle,代码行数:8,代码来源:FullAutoFieldTest.java

示例8: decodeMap

import com.addthis.codec.config.Configs; //导入依赖的package包/类
public static ValueMap decodeMap(@Syntax("HOCON") String config) throws IOException {
    return Configs.decodeObject(ValueMap.class, config);
}
 
开发者ID:addthis,项目名称:bundle,代码行数:4,代码来源:ValueFactory.java

示例9: decode

import com.addthis.codec.config.Configs; //导入依赖的package包/类
public static MapBundle decode(@Syntax("HOCON") String config) throws IOException {
    return Configs.decodeObject(MapBundle.class, config);
}
 
开发者ID:addthis,项目名称:bundle,代码行数:4,代码来源:MapBundle.java

示例10: decode

import com.addthis.codec.config.Configs; //导入依赖的package包/类
@Scaling(SETUP)
public static Bundle decode(@Syntax("HOCON") String config) throws IOException {
    return Configs.decodeObject(Bundle.class, config);
}
 
开发者ID:addthis,项目名称:bundle,代码行数:5,代码来源:Bundles.java

示例11: accessByIndex

import com.addthis.codec.config.Configs; //导入依赖的package包/类
@Test
public void accessByIndex() throws Exception {
    Bundle bundle = makeListBundleWithOrder();
    AutoField field = Configs.decodeObject(AutoField.class, "index = 1");
    assertEquals("there", field.getValue(bundle).asNative());
}
 
开发者ID:addthis,项目名称:bundle,代码行数:7,代码来源:IndexFieldTest.java

示例12: createSampleFilter

import com.addthis.codec.config.Configs; //导入依赖的package包/类
@Override protected SimpleCopyFilter createSampleFilter() throws IOException {
    return Configs.decodeObject(SimpleCopyFilter.class, "from.const {codec = good}, to = [b, sub-b]");
}
 
开发者ID:addthis,项目名称:bundle,代码行数:4,代码来源:ConstantFieldTest.java

示例13: createSampleFilter

import com.addthis.codec.config.Configs; //导入依赖的package包/类
@Override protected SimpleCopyFilter createSampleFilter() throws IOException {
    return Configs.decodeObject(SimpleCopyFilter.class, "from = [a, 0], to = [b, sub-b]");
}
 
开发者ID:addthis,项目名称:bundle,代码行数:4,代码来源:FullAutoFieldTest.java

示例14: createSampleFilter

import com.addthis.codec.config.Configs; //导入依赖的package包/类
protected SimpleCopyFilter createSampleFilter() throws IOException {
    return Configs.decodeObject(SimpleCopyFilter.class, "from = a, to = b");
}
 
开发者ID:addthis,项目名称:bundle,代码行数:4,代码来源:AutoFieldTest.java


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