private final Boolean _findSortAlpha(Annotated ann) { JsonPropertyOrder order = _findAnnotation(ann, JsonPropertyOrder.class); // 23-Jun-2015, tatu: as per [databind#840], let's only consider // `true` to have any significance. if ((order != null) && order.alphabetic()) { return Boolean.TRUE; } return null; }
@Test public void shouldHaveJsonPropertyAnnotation() throws Exception { // Given final T op = getTestObject(); // When final JsonPropertyOrder annotation = op.getClass().getAnnotation(JsonPropertyOrder.class); // Then assumeTrue("Missing JsonPropertyOrder annotation on class. It should de defined and set to alphabetical." + op.getClass().getName(), null != annotation && annotation.alphabetic()); }
@Override public Boolean findSerializationSortAlphabetically(AnnotatedClass ac) { JsonPropertyOrder order = ac.getAnnotation(JsonPropertyOrder.class); return (order == null) ? null : order.alphabetic(); }
private final Boolean _findSortAlpha(Annotated ann) { JsonPropertyOrder order = _findAnnotation(ann, JsonPropertyOrder.class); // 23-Jun-2015, tatu: as per [databind#840], let's only consider // `true` to have any significance. if ((order != null) && order.alphabetic()) { return Boolean.TRUE; } return null; }
@Override public Boolean findSerializationSortAlphabetically(AnnotatedClass ac) { JsonPropertyOrder order = ac.getAnnotation(JsonPropertyOrder.class); return (order == null) ? null : order.alphabetic(); }
private final Boolean _findSortAlpha(Annotated ann) { JsonPropertyOrder order = _findAnnotation(ann, JsonPropertyOrder.class); return (order == null) ? null : order.alphabetic(); }
private final Boolean _findSortAlpha(Annotated ann) { JsonPropertyOrder order = _findAnnotation(ann, JsonPropertyOrder.class); /* 23-Jun-2015, tatu: as per [databind#840], let's only consider * `true` to have any significance. */ if ((order != null) && order.alphabetic()) { return Boolean.TRUE; } return null; }
private final Boolean _findSortAlpha(Annotated ann) { JsonPropertyOrder order = _findAnnotation(ann, JsonPropertyOrder.class); return (order == null) ? null : order.alphabetic(); }
private boolean alphabetizeOrphans(Class<T> instanceClazz) { if (instanceClazz.isAnnotationPresent(JsonPropertyOrder.class)) { return instanceClazz.getAnnotation(JsonPropertyOrder.class).alphabetic(); } throw new CatnapException("Missing CatnapOrder or JsonPropertyOrder annotation"); } }
@SuppressWarnings({"unchecked", "rawtypes"}) public ResourceInformation build(Class<?> resourceClass) { List<AnnotatedResourceField> resourceFields = getResourceFields(resourceClass); String resourceType = getResourceType(resourceClass); Optional<JsonPropertyOrder> propertyOrder = ClassUtils.getAnnotation(resourceClass, JsonPropertyOrder.class); if (propertyOrder.isPresent()) { JsonPropertyOrder propertyOrderAnnotation = propertyOrder.get(); Collections.sort(resourceFields, new FieldOrderedComparator(propertyOrderAnnotation.value(), propertyOrderAnnotation.alphabetic())); } DefaultResourceInstanceBuilder<?> instanceBuilder = new DefaultResourceInstanceBuilder(resourceClass); Class<?> superclass = resourceClass.getSuperclass(); String superResourceType = superclass != Object.class && context.accept(superclass) ? context.getResourceType(superclass) : null; return new ResourceInformation(context.getTypeParser(), resourceClass, resourceType, superResourceType, instanceBuilder, (List) resourceFields); }
if (propOrderInfo != null) { propOrder = propOrderInfo.value(); alphabetical = propOrderInfo.alphabetic();
if (propOrderInfo != null) { propOrder = propOrderInfo.value(); alphabetical = propOrderInfo.alphabetic();
builder.setPropertyOrderAlphabetic( jsonPropertyOrder.isPresent() && jsonPropertyOrder.get().alphabetic() ); if ( jsonPropertyOrder.isPresent() && jsonPropertyOrder.get().value().length > 0 ) { builder.setPropertyOrderList( Arrays.asList( jsonPropertyOrder.get().value() ) );