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

Java BeanToPropertyValueTransformer类代码示例

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

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



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

示例1: deepSort

import org.apache.commons.beanutils.BeanToPropertyValueTransformer; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void deepSort(DefaultMutableTreeNode parent,
		TreeObjectSortBy sortBy, SortOrder order) {
	Enumeration<DefaultMutableTreeNode> treeObjectNodes = parent.children();
	List<DefaultMutableTreeNode> treeNodes = EnumerationUtils
			.toList(treeObjectNodes);

	BeanToPropertyValueTransformer sortProperty = getSortByTransformer(sortBy);

	Comparator<DefaultMutableTreeNode> comparator = new TransformingComparator(
			sortProperty);

	if (SortOrder.DESC.equals(order)) {
		comparator = new ReverseComparator<DefaultMutableTreeNode>(
				comparator);
	}

	Collections.sort(treeNodes, comparator);

	parent.removeAllChildren();
	for (DefaultMutableTreeNode childNode : treeNodes) {
		parent.add(childNode);
		deepSort(childNode, sortBy, order);
	}
}
 
开发者ID:link-intersystems,项目名称:GitDirStat,代码行数:26,代码来源:GitRepositoryTreeNode.java


示例2: getSortByTransformer

import org.apache.commons.beanutils.BeanToPropertyValueTransformer; //导入依赖的package包/类
private BeanToPropertyValueTransformer getSortByTransformer(
		TreeObjectSortBy sortBy) {
	String sortProperty = null;
	switch (sortBy) {
	case NAME:
		sortProperty = "userObject.path.pathname";
		break;
	case SIZE:
		sortProperty = "userObject.size";
		break;

	default:
		sortProperty = "userObject";
		break;
	}
	BeanToPropertyValueTransformer beanValueTransformer = new BeanToPropertyValueTransformer(
			sortProperty);
	return beanValueTransformer;
}
 
开发者ID:link-intersystems,项目名称:GitDirStat,代码行数:20,代码来源:GitRepositoryTreeNode.java


示例3: doSliderRange

import org.apache.commons.beanutils.BeanToPropertyValueTransformer; //导入依赖的package包/类
private void doSliderRange(JspWriter out)  throws JspException, IOException {
    List<Product> products = ((SearchFilterTag) getParent()).getProducts();

    Money min = null;
    Money max = null;
    BeanToPropertyValueTransformer valueTransformer = new BeanToPropertyValueTransformer(property, true);

    for (Product product : products) {
        Money propertyObject = (Money) valueTransformer.transform(product);
        if (propertyObject == null) {
            min = new Money(0D);
            max = new Money(0D);
        } else {
            min = propertyObject.min(min);
            max = propertyObject.max(max);
        }
    }

    String propertyCss = property.replaceAll("[.\\[\\]]", "_");

    out.println("<div id='searchFilter-"+propertyCss+"'></div>");
    out.println("Range:");
    out.println("<input type=\"text\" id=\"min-" + propertyCss + "\" name='min-" + property + "' value='"+min.getCurrency().getSymbol()+min.getAmount().toPlainString()+"'/> - ");
    out.println("<input type=\"text\" id=\"max-" + propertyCss + "\" name='max-" + property + "' value='"+max.getCurrency().getSymbol()+max.getAmount().toPlainString()+"'/> <br/>");

    out.println("        <script type=\"text/javascript\">\r\n" +
            "        $(function() {\r\n" +
            "            $(\"#searchFilter-" + propertyCss + "\").slider({\r\n" +
            "                range: true,\r\n" +
            "                min: "+ min.getAmount().toPlainString() +", max: "+ max.getAmount().toPlainString() + "," +
            "                values: ["+ min.getAmount().toPlainString() +","+ max.getAmount().toPlainString() +"]," +
            "                slide: function(event, ui) {\r\n" +
            "                    $(\"#min-" + propertyCss + "\").val('" + min.getCurrency().getSymbol() + "' + ui.values[0] );\r\n" +
            "                    $(\"#max-" + propertyCss + "\").val('" + max.getCurrency().getSymbol() + "' + ui.values[1]);\r\n" +
            "                }\r\n" +
            "            });\r\n" +
            "        });\r\n" +
            "        $('#searchFilter-"+propertyCss+"').bind('slidechange',  updateSearchFilterResults); \r\n" +
    "        </script>");
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:41,代码来源:SearchFilterItemTag.java


示例4: addProjections

import org.apache.commons.beanutils.BeanToPropertyValueTransformer; //导入依赖的package包/类
/**
 * JAVADOC Method Level Comments
 *
 * @param subjectType
 *            JAVADOC.
 * @param search
 *            JAVADOC.
 * @param projections
 *            JAVADOC.
 * @see org.cucina.meringue.search.SearchBeanFactory#addProjections(java.lang
 *      .String, org.cucina.meringue.query.SearchBean, java.lang.String[])
 */
@SuppressWarnings("unchecked")
@Override
public void addProjections(String subjectType, SearchBean search,
    Collection<String> projections, Class<?>... projectionGroup) {
    Assert.notNull(search, "search is required!");
    Assert.hasText(subjectType, "subjectType is required!");
    Assert.notEmpty(projections, "projections is required!");

    addProjections(subjectType, search, projectionGroup);

    ArrayList<Projection> orderedProjections = new ArrayList<Projection>();

    for (String requestedProjection : projections) {
        for (Iterator<Projection> iter = search.getProjections().iterator(); iter.hasNext();) {
            Projection projection = iter.next();

            if (requestedProjection.equals(projection.getAlias())) {
                orderedProjections.add(projection);
                iter.remove();

                break;
            }
        }
    }

    search.setProjections(orderedProjections);

    Collection<String> unresolved = CollectionUtils.subtract(projections,
            CollectionUtils.collect(search.getProjections(),
                new BeanToPropertyValueTransformer("alias")));

    if (LOG.isDebugEnabled()) {
        LOG.debug("The following requested projections " + unresolved + " could not be found");
    }

    Assert.notEmpty(search.getProjections(), "No projections could be added!");
}
 
开发者ID:cucina,项目名称:opencucina,代码行数:50,代码来源:SearchBeanFactoryImpl.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ELText类代码示例发布时间:2022-05-22
下一篇:
Java AsyncTransaction类代码示例发布时间: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