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

Java FieldDictionary类代码示例

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

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



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

示例1: testSortsFieldOrderWithArray

import com.thoughtworks.xstream.converters.reflection.FieldDictionary; //导入依赖的package包/类
public void testSortsFieldOrderWithArray() {

		SortableFieldKeySorter sorter = new SortableFieldKeySorter();
		sorter.registerFieldOrder(MommyBear.class,
				new String[] { "b", "c", "a" });

		xstream = new XStream(new PureJavaReflectionProvider(new FieldDictionary(sorter)));
		setupSecurity(xstream);
		xstream.alias("mommy", MommyBear.class);
		MommyBear root = new MommyBear();
		root.c = "ccc";
		root.b = "bbb";
		root.a = "aaa";
		assertBothWays(root, "<mommy>\n" + "  <b>bbb</b>\n" + "  <c>ccc</c>\n"
				+ "  <a>aaa</a>\n" + "</mommy>");
	}
 
开发者ID:x-stream,项目名称:xstream,代码行数:17,代码来源:SortableFieldListTest.java


示例2: testSortsFieldOrderWhileUsingInheritance

import com.thoughtworks.xstream.converters.reflection.FieldDictionary; //导入依赖的package包/类
public void testSortsFieldOrderWhileUsingInheritance() {

		SortableFieldKeySorter sorter = new SortableFieldKeySorter();
		sorter.registerFieldOrder(BabyBear.class,
				new String[] { "b", "d", "c", "a" });

		xstream = new XStream(new PureJavaReflectionProvider(new FieldDictionary(sorter)));
                setupSecurity(xstream);
		xstream.alias("baby", BabyBear.class);
		BabyBear root = new BabyBear();
		root.c = "ccc";
		root.b = "bbb";
		root.a = "aaa";
		root.d = "ddd";
		assertBothWays(root, "<baby>\n" + "  <b>bbb</b>\n" + "  <d>ddd</d>\n"
				+ "  <c>ccc</c>\n" + "  <a>aaa</a>\n" + "</baby>");
	}
 
开发者ID:x-stream,项目名称:xstream,代码行数:18,代码来源:SortableFieldListTest.java


示例3: readResolve

import com.thoughtworks.xstream.converters.reflection.FieldDictionary; //导入依赖的package包/类
private Object readResolve() {
    fieldDictionary = new FieldDictionary();
    attributeMap = new HashMap();
    for (final Iterator iterator = fieldDictionary.fieldsFor(type); iterator
        .hasNext();) {
        final Field field = (Field)iterator.next();
        if (field.getType() == type && Modifier.isStatic(field.getModifiers())) {
            try {
                final Object attribute = field.get(null);
                attributeMap.put(toString(attribute), attribute);
            } catch (IllegalAccessException e) {
                throw new ObjectAccessException("Cannot get object of " + field, e);
            }
        }
    }
    return this;
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:18,代码来源:AbstractAttributedCharacterIteratorAttributeConverter.java


示例4: createInstance

import com.thoughtworks.xstream.converters.reflection.FieldDictionary; //导入依赖的package包/类
/**
 * Returns a ReflectionProvider that provides core reflection services.
 *
 * @return configured reflection provider.
 */
@Override
protected final ReflectionProvider createInstance() {
	SortableFieldKeySorter sorter = new SortableFieldKeySorter();

	sorter.registerFieldOrder(TaxonName.class,
			ReflectionProviderFactory.TAXON_NAME_FIELDS);

	FieldDictionary fieldDictionary = new FieldDictionary(sorter);

	ReflectionProvider reflectionProvider
	= new Sun14ReflectionProvider(fieldDictionary);
	return reflectionProvider;
}
 
开发者ID:RBGKew,项目名称:eMonocot,代码行数:19,代码来源:ReflectionProviderFactory.java


示例5: testCanWriteInheritanceHierarchiesInOldOrder

import com.thoughtworks.xstream.converters.reflection.FieldDictionary; //导入依赖的package包/类
public void testCanWriteInheritanceHierarchiesInOldOrder() {
    xstream = new XStream(new PureJavaReflectionProvider(new FieldDictionary(new XStream12FieldKeySorter())));
    OpenSourceSoftware openSourceSoftware = new OpenSourceSoftware("apache", "geronimo", "license");
    String xml =
            "<oss>\n" +
            "  <license>license</license>\n" +
            "  <vendor>apache</vendor>\n" +
            "  <name>geronimo</name>\n" +
            "</oss>";

    xstream.alias("oss", OpenSourceSoftware.class);
    assertEquals(xml, xstream.toXML(openSourceSoftware));
}
 
开发者ID:x-stream,项目名称:xstream,代码行数:14,代码来源:XStream12CompatibilityTest.java


示例6: createXStream

import com.thoughtworks.xstream.converters.reflection.FieldDictionary; //导入依赖的package包/类
protected XStream createXStream() {
    XStream xstream = new XStream(new PureJavaReflectionProvider(new FieldDictionary(
        new AlphabeticalFieldkeySorter())));
    setupSecurity(xstream);
    return xstream;
}
 
开发者ID:x-stream,项目名称:xstream,代码行数:7,代码来源:CustomFieldKeySorterTest.java


示例7: newReflectionProvider

import com.thoughtworks.xstream.converters.reflection.FieldDictionary; //导入依赖的package包/类
public static ReflectionProvider newReflectionProvider(FieldDictionary paramFieldDictionary)
{
  return (ReflectionProvider)DependencyInjectionFactory.newInstance(reflectionProviderType, new Object[] { paramFieldDictionary });
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:JVM.java


示例8: getDefaultStreamer

import com.thoughtworks.xstream.converters.reflection.FieldDictionary; //导入依赖的package包/类
public static XStream getDefaultStreamer() {
	return new XStream(new PureJavaReflectionProvider(new FieldDictionary(new NativeFieldKeySorter())), new DomDriver("UTF-8"));
}
 
开发者ID:BrainTech,项目名称:svarog,代码行数:4,代码来源:XMLUtils.java


示例9: newReflectionProvider

import com.thoughtworks.xstream.converters.reflection.FieldDictionary; //导入依赖的package包/类
/**
 * Create the best matching ReflectionProvider.
 * 
 * @param dictionary the FieldDictionary to use by the ReflectionProvider
 * @return a new instance
 * @since 1.4.5
 */
public static ReflectionProvider newReflectionProvider(final FieldDictionary dictionary) {
    return DependencyInjectionFactory.newInstance(reflectionProviderType, dictionary);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:JVM.java


示例10: newReflectionProvider

import com.thoughtworks.xstream.converters.reflection.FieldDictionary; //导入依赖的package包/类
/**
 * Create the best matching ReflectionProvider.
 *
 * @param dictionary the FieldDictionary to use by the ReflectionProvider
 * @return a new instance
 * @since 1.4.5
 */
public static ReflectionProvider newReflectionProvider(final FieldDictionary dictionary) {
    return DependencyInjectionFactory.newInstance(reflectionProviderType, dictionary);
}
 
开发者ID:x-stream,项目名称:xstream,代码行数:11,代码来源:JVM.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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