本文整理汇总了Java中org.apache.commons.beanutils.BeanToPropertyValueTransformer.transform方法的典型用法代码示例。如果您正苦于以下问题:Java BeanToPropertyValueTransformer.transform方法的具体用法?Java BeanToPropertyValueTransformer.transform怎么用?Java BeanToPropertyValueTransformer.transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.beanutils.BeanToPropertyValueTransformer
的用法示例。
在下文中一共展示了BeanToPropertyValueTransformer.transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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>");
}