Package org.apache.commons.beanutils

Examples of org.apache.commons.beanutils.BeanComparator


                // replace jsp.version property as well
                project.getOriginalModel().getProperties().setProperty("jsp.version", "2.1");
            }
        }

        Collections.sort(newDependencies, new BeanComparator("groupId"));

        project.getOriginalModel().setDependencies(newDependencies);

        Properties currentProperties = project.getOriginalModel().getProperties();
View Full Code Here


     * @param list the java.util.List to sort
     * @return ordered list
     */
    @SuppressWarnings("unchecked")
    protected List sort(List list) {
        Comparator comparator = new BeanComparator(sortColumn, new NullComparator(nullsAreHigh));
        if (!ascending) {
            comparator = new ReverseComparator(comparator);
        }
        Collections.sort(list, comparator);
        return list;
View Full Code Here

     * @param list the java.util.List to sort
     * @return ordered list
     */
    @SuppressWarnings("unchecked")
    protected List sort(List list) {
        Comparator comparator = new BeanComparator(sortColumn, new NullComparator(nullsAreHigh));
        if (!ascending) {
            comparator = new ReverseComparator(comparator);
        }
        Collections.sort(list, comparator);
        return list;
View Full Code Here

    List<T> values = this.getValues();
   
    // perhaps apply a sort...
    if( sortProperty != null ) {
      Comparator<T> comparator = new BeanComparator( sortProperty );
      if( !sortAsc ) {
        comparator = Collections.reverseOrder( comparator );
      }
      Collections.sort( values, comparator );
    }
View Full Code Here

  public OrderByComparator<T> orderBy(final String property) {
    return orderBy(property, false);
  }
 
  public OrderByComparator<T> orderBy(final String property, final boolean descending) {
    comparatorChain.addComparator(new BeanComparator(property), descending);
    return this;
  }
View Full Code Here

     *            the java.util.List to sort
     * @return ordered list
     */
    @SuppressWarnings("unchecked")
    protected List sort(final List list) {
        Comparator comparator = new BeanComparator(this.sortColumn,
                new NullComparator(this.nullsAreHigh));
        if (!this.ascending) {
            comparator = new ReverseComparator(comparator);
        }
        Collections.sort(list, comparator);
View Full Code Here

                // replace jsp.version property as well
                project.getOriginalModel().getProperties().setProperty("jsp.version", "2.1");
            }
        }

        Collections.sort(newDependencies, new BeanComparator("groupId"));

        project.getOriginalModel().setDependencies(newDependencies);

        Properties currentProperties = project.getOriginalModel().getProperties();
View Full Code Here

         * @return
         * @throws ECARException
         */
        public List ordenaList(List colecao, String campo) throws ECARException{
       Collection medias = colecao;
       BeanComparator ordenaMedia = new BeanComparator(campo,  
           new Comparator() { 
             public int compare(Object o1, Object o2) {             
               return ((Comparable)o2).compareTo((Comparable)o1)
            
           } 
View Full Code Here

        * @return
        * @throws ECARException
        */
       public List ordenaListInvert(List colecao, String campo) throws ECARException{
       Collection medias = colecao;
       BeanComparator ordenaMedia = new BeanComparator(campo,  
           new Comparator() { 
             public int compare(Object o1, Object o2) {             
               return ((Comparable)o2).compareTo((Comparable)o1)*-1
            
           } 
View Full Code Here

            models = systemNotificationService.getAllForTypes(true, types);
        } else {
            models = systemNotificationService.getAllModels(true);
        }

        Comparator<SystemNotificationModel> notificationTypeComparator = new BeanComparator("notificationType", new SystemNotificationTypeComparator());
        Comparator<SystemNotificationModel> notificationSeverityComparator = new BeanComparator("notificationSeverity", new SystemNotificationSeverityComparator());

        ComparatorChain chain = new ComparatorChain();
        chain.addComparator(notificationTypeComparator);
        chain.addComparator(notificationSeverityComparator);
View Full Code Here

TOP

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

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.