Package org.springframework.core.annotation

Examples of org.springframework.core.annotation.Order


            if (obj instanceof Ordered) {
                return ((Ordered) obj).getOrder();
            }
            if (obj != null) {
                Class<?> clazz = (obj instanceof Class ? (Class<?>) obj : obj.getClass());
                Order order = AnnotationUtils.findAnnotation(clazz,Order.class);
                if (order != null) {
                    return order.value();
                }
            }
            return Ordered.LOWEST_PRECEDENCE;
        }
View Full Code Here


    if ( bean instanceof Ordered ) {
      return ( (Ordered) bean ).getOrder();
    }
    if ( bean != null ) {
      Class<?> clazz = ( bean instanceof Class ? (Class<?>) bean : bean.getClass() );
      Order order = AnnotationUtils.findAnnotation( clazz, Order.class );
      if ( order != null ) {
        return order.value();
      }
    }
    return DEFAUL_GLOBAL_ORDER;
  }
View Full Code Here

*/
public class InterpreterComparator implements Comparator<Interpreter> {

    @Override
    public int compare(Interpreter thees, Interpreter that) {
        Order thessOrder = thees.getClass().getAnnotation(Order.class);
        Order thatOrder = that.getClass().getAnnotation(Order.class);
        int thessValue = thessOrder == null ? 0 : thessOrder.value();
        int thatValue = thatOrder == null ? 0 : thatOrder.value();
        return thessValue - thatValue;
    }
View Full Code Here

TOP

Related Classes of org.springframework.core.annotation.Order

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.