@Test public void testProcess_Simple_ASC_INSENSITIVE() { List<Sort> orderings = parser.parse("name", "ASC_CI"); assertEquals(1, orderings.size()); assertEquals("name", orderings.get(0).getProperty()); assertEquals(Dir.ASC_CI, orderings.get(0).getDirection()); }
@Override public List<Sort> parse(String unparsedSort, String unparsedDir) { if (unparsedSort == null || unparsedSort.isEmpty()) { return Collections.emptyList(); } List<Sort> orderings = new ArrayList<>(3); if (unparsedSort.startsWith("[")) { appendFromArray(orderings, jsonParser.parseJson(unparsedSort)); } else if (unparsedSort.startsWith("{")) { appendFromObject(orderings, jsonParser.parseJson(unparsedSort)); } else { appendPath(orderings, unparsedSort, unparsedDir); } return orderings; }
SortParser implements ISortParser { @Override public List<Sort> parse(String unparsedSort, String unparsedDir) { if (unparsedSort == null || unparsedSort.isEmpty()) { return Collections.emptyList(); } List<Sort> orderings = new ArrayList<>(3); if (unparsedSort.startsWith("[")) { appendFromArray(orderings, jsonParser.parseJson(unparsedSort)); } else if (unparsedSort.startsWith("{")) { appendFromObject(orderings, jsonParser.parseJson(unparsedSort)); } else { appendPath(orderings, unparsedSort, unparsedDir); } return orderings; } }
SortParser implements ISortParser { @Override public List<Sort> parse(String unparsedSort, String unparsedDir) { if (unparsedSort == null || unparsedSort.isEmpty()) { return Collections.emptyList(); } List<Sort> orderings = new ArrayList<>(3); if (unparsedSort.startsWith("[")) { appendFromArray(orderings, jsonParser.parseJson(unparsedSort)); } else if (unparsedSort.startsWith("{")) { appendFromObject(orderings, jsonParser.parseJson(unparsedSort)); } else { appendPath(orderings, unparsedSort, unparsedDir); } return orderings; } SortParser(@Inject IJacksonService jsonParser); }
SortParser implements ISortParser { @Override public List<Sort> parse(String unparsedSort, String unparsedDir) { if (unparsedSort == null || unparsedSort.isEmpty()) { return Collections.emptyList(); } List<Sort> orderings = new ArrayList<>(3); if (unparsedSort.startsWith("[")) { appendFromArray(orderings, jsonParser.parseJson(unparsedSort)); } else if (unparsedSort.startsWith("{")) { appendFromObject(orderings, jsonParser.parseJson(unparsedSort)); } else { appendPath(orderings, unparsedSort, unparsedDir); } return orderings; } SortParser(@Inject IJacksonService jsonParser); @Override List<Sort> parse(String unparsedSort, String unparsedDir); @Override List<Sort> parseJson(JsonNode json); }
SortParser implements ISortParser { @Override public List<Sort> parse(String unparsedSort, String unparsedDir) { if (unparsedSort == null || unparsedSort.isEmpty()) { return Collections.emptyList(); } List<Sort> orderings = new ArrayList<>(3); if (unparsedSort.startsWith("[")) { appendFromArray(orderings, jsonParser.parseJson(unparsedSort)); } else if (unparsedSort.startsWith("{")) { appendFromObject(orderings, jsonParser.parseJson(unparsedSort)); } else { appendPath(orderings, unparsedSort, unparsedDir); } return orderings; } SortParser(@Inject IJacksonService jsonParser); @Override List<Sort> parse(String unparsedSort, String unparsedDir); @Override List<Sort> parseJson(JsonNode json);  }