/** * @param sort when true, sort annotation members by name (case sensitive) */ public AnnotationVisitor(boolean sort) { if (sort) { mMethodComparator = BeanComparator .forClass(Method.class).orderBy("name").caseSensitive(); } else { mMethodComparator = null; } }
/** * @param sort when true, sort annotation members by name (case sensitive) */ public AnnotationVisitor(boolean sort) { if (sort) { mMethodComparator = BeanComparator .forClass(Method.class).orderBy("name").caseSensitive(); } else { mMethodComparator = null; } }
/** * @param sort when true, sort annotation members by name (case sensitive) */ public AnnotationVisitor(boolean sort) { if (sort) { mMethodComparator = BeanComparator .forClass(Method.class).orderBy("name").caseSensitive(); } else { mMethodComparator = null; } }
/** * @param sort when true, sort annotation members by name (case sensitive) */ public AnnotationVisitor(boolean sort) { if (sort) { mMethodComparator = BeanComparator .forClass(Method.class).orderBy("name").caseSensitive(); } else { mMethodComparator = null; } }
private static BeanComparator orderBy(BeanComparator bc, String property, Class type, Direction direction) { bc = bc.orderBy(property); if (type != null && type.isArray()) { TypeDesc td = TypeDesc.forClass(type); if (td.getRootComponentType() == TypeDesc.BYTE) { bc = bc.using(Comparators.arrayComparator(type, true)); } else { Comparator c = Comparators.arrayComparator(type, false); if (c == null) { throw new IllegalArgumentException("Cannot sort by property type of " + type.getName() + " for " + property); } bc = bc.using(c); } } else { bc = bc.caseSensitive(); } if (direction == Direction.DESCENDING) { bc = bc.reverse(); } return bc; }
private static BeanComparator orderBy(BeanComparator bc, String property, Class type, Direction direction) { bc = bc.orderBy(property); if (type != null && type.isArray()) { TypeDesc td = TypeDesc.forClass(type); if (td.getRootComponentType() == TypeDesc.BYTE) { bc = bc.using(Comparators.arrayComparator(type, true)); } else { Comparator c = Comparators.arrayComparator(type, false); if (c == null) { throw new IllegalArgumentException("Cannot sort by property type of " + type.getName() + " for " + property); } bc = bc.using(c); } } else { bc = bc.caseSensitive(); } if (direction == Direction.DESCENDING) { bc = bc.reverse(); } return bc; }