Package org.apache.commons.beanutils

Examples of org.apache.commons.beanutils.BeanToPropertyValueTransformer


                if (zips.length > 0 || dirty)
                {
                    apps = appsDir.list(DirectoryFileFilter.DIRECTORY);
                }

                Collection deployedAppNames = CollectionUtils.collect(applications, new BeanToPropertyValueTransformer("appName"));

                // new exploded Mule apps
                @SuppressWarnings("unchecked")
                final Collection<String> addedApps = CollectionUtils.subtract(Arrays.asList(apps), deployedAppNames);
                for (String addedApp : addedApps)
View Full Code Here


    }
   
   
    @Override
    public boolean evaluate(final Object object) {
      final Object propertyValue = new BeanToPropertyValueTransformer(property, true).transform(object);
      final Locale locale = Constants.DEFAULT_LOCALE;
      return ObjectUtils.toString(propertyValue).toLowerCase(locale).contains(
          value.toLowerCase(locale));
    }
View Full Code Here

        }
        out.println("</ul>");
    }
   
    private void doProductMultiSelect(JspWriter out, List<Product> products) throws JspException, IOException{
        BeanToPropertyValueTransformer valueTransformer = new BeanToPropertyValueTransformer(property, true);
        BeanToPropertyValueTransformer displayTransformer;
        if (propertyDisplay != null) {
            displayTransformer = new BeanToPropertyValueTransformer(propertyDisplay, true);
        } else {
            displayTransformer = valueTransformer;
        }

        HashMap<Object, Integer> countMap = new HashMap<Object, Integer>();
        HashMap<Object, Object> valueDisplayMap = new HashMap<Object, Object>();
        for (Product product : products) {
            Object value = valueTransformer.transform(product);
            Object display = displayTransformer.transform(product);
            valueDisplayMap.put(value, display);
            Integer integer = countMap.get(value);
            if (integer == null) {
                countMap.put(value, new Integer(1));
            } else {
View Full Code Here

    private void doSliderRange(JspWriter outthrows 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);
View Full Code Here

     * @param parameters the parameters passed to the controller. Generally request.getParameterMap()
     * @param allowedParameters an array of the allowed parameters to filter on
     */
    public static void filterProducts(List<Product> products,  Map<String, String[]>parameters, String[] allowedParameters) {
        for (String parameter : allowedParameters) {
            BeanToPropertyValueTransformer reader = new BeanToPropertyValueTransformer(parameter, true);
            if (parameters.containsKey(parameter)) { // we're doing a multi-select
                for (Iterator<Product> itr = products.iterator(); itr.hasNext(); ) {
                    Product product = itr.next();
                    if (!ArrayUtils.contains(parameters.get(parameter), reader.transform(product).toString())) {
                        itr.remove();
                    }
                }
            } else if (parameters.containsKey("min-"+parameter)) {
                String minMoney = parameters.get("min-" + parameter)[0];
                String maxMoney = parameters.get("max-" + parameter)[0];
                Money minimumMoney = new Money(minMoney.replaceAll("[^0-9.]", ""));
                Money maximumMoney = new Money(maxMoney.replaceAll("[^0-9.]", ""));
                for (Iterator<Product> itr = products.iterator(); itr.hasNext();) {
                    Product product = itr.next();
                    Money objectValue = (Money) reader.transform(product);
                    if (objectValue.lessThan(minimumMoney) || objectValue.greaterThan(maximumMoney)) {
                        itr.remove();
                    }
                }
            }
View Full Code Here

    public T deployExplodedArtifact(String artifactDir) throws DeploymentException
    {
        String artifactName = artifactDir;
        @SuppressWarnings("rawtypes")
        Collection<String> deployedAppNames = CollectionUtils.collect(artifacts, new BeanToPropertyValueTransformer(ARTIFACT_NAME_PROPERTY));

        if (deployedAppNames.contains(artifactName) && (!artifactZombieMap.containsKey(artifactName)))
        {
            return null;
        }
View Full Code Here

        String jobName = createJobName(scheduledRemoteProviderImport);

        JobDetail job = new JobDetail(jobName, groupName, ScheduledRemoteProviderImportJob.class);

        List<RemoteProviderType> remoteProviderTypes = remoteProviderTypeService.loadAll();
        List<Integer> idList = (List<Integer>)CollectionUtils.collect(remoteProviderTypes, new BeanToPropertyValueTransformer("id"));
        String remoteProviderTypeIds = StringUtils.join(idList, ",");

        job.getJobDataMap().put("remoteProviderTypeIds", remoteProviderTypeIds);
        job.getJobDataMap().put("queueSender", queueSender);
View Full Code Here

TOP

Related Classes of org.apache.commons.beanutils.BeanToPropertyValueTransformer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.