@Test public final void shouldReturnFieldNameUsingExpressionWithSaveNavOperator5() { final FieldDefinition fieldDefinition = mockFieldDefinition(TEST_FIELD, Object.class); final Map<String, GridComponentColumn> columns = ImmutableMap.of( TEST_COL, buildGridComponentColumn(TEST_COL, fieldDefinition, "#belongsTo?.get('secondBelongsTo').get('thirdBelongsTo')?.get('field')")); final String fieldName = GridComponentFilterUtils.getFieldNameByColumnName(columns, TEST_COL); assertEquals("belongsTo.secondBelongsTo.thirdBelongsTo.field", fieldName); }
public static String getFieldNameByColumnName(final Map<String, GridComponentColumn> columns, final String columnName) { GridComponentColumn column = columns.get(columnName); if (column == null) { return null; } final String expression = column.getExpression(); if (StringUtils.isNotBlank(expression)) { return getFieldNameFromExpression(expression); } else if (column.getFields().size() == 1) { return column.getFields().get(0).getName(); } return null; }
GridComponentFilterUtils { public static String getFieldNameByColumnName(final Map<String, GridComponentColumn> columns, final String columnName) { GridComponentColumn column = columns.get(columnName); if (column == null) { return null; } final String expression = column.getExpression(); if (StringUtils.isNotBlank(expression)) { return getFieldNameFromExpression(expression); } else if (column.getFields().size() == 1) { return column.getFields().get(0).getName(); } return null; } }
GridComponentFilterUtils { public static String getFieldNameByColumnName(final Map<String, GridComponentColumn> columns, final String columnName) { GridComponentColumn column = columns.get(columnName); if (column == null) { return null; } final String expression = column.getExpression(); if (StringUtils.isNotBlank(expression)) { return getFieldNameFromExpression(expression); } else if (column.getFields().size() == 1) { return column.getFields().get(0).getName(); } return null; } private  GridComponentFilterUtils(); }
GridComponentFilterUtils { public static String getFieldNameByColumnName(final Map<String, GridComponentColumn> columns, final String columnName) { GridComponentColumn column = columns.get(columnName); if (column == null) { return null; } final String expression = column.getExpression(); if (StringUtils.isNotBlank(expression)) { return getFieldNameFromExpression(expression); } else if (column.getFields().size() == 1) { return column.getFields().get(0).getName(); } return null; } private  GridComponentFilterUtils(); static void addFilters(final Map<String, String> filters, final Map<String, GridComponentColumn> columns,
            final DataDefinition dataDefinition, final SearchCriteriaBuilder criteria); static void addMultiSearchFilter(GridComponentMultiSearchFilter multiSearchFilter,
            Map<String, GridComponentColumn> columns, DataDefinition dataDefinition, SearchCriteriaBuilder criteria); static String addAliases(final SearchCriteriaBuilder criteria, final String field, final JoinType joinType); static String getFieldNameByColumnName(final Map<String, GridComponentColumn> columns, final String columnName); }
GridComponentFilterUtils { public static String getFieldNameByColumnName(final Map<String, GridComponentColumn> columns, final String columnName) { GridComponentColumn column = columns.get(columnName); if (column == null) { return null; } final String expression = column.getExpression(); if (StringUtils.isNotBlank(expression)) { return getFieldNameFromExpression(expression); } else if (column.getFields().size() == 1) { return column.getFields().get(0).getName(); } return null; } private  GridComponentFilterUtils(); static void addFilters(final Map<String, String> filters, final Map<String, GridComponentColumn> columns,
            final DataDefinition dataDefinition, final SearchCriteriaBuilder criteria); static void addMultiSearchFilter(GridComponentMultiSearchFilter multiSearchFilter,
            Map<String, GridComponentColumn> columns, DataDefinition dataDefinition, SearchCriteriaBuilder criteria); static String addAliases(final SearchCriteriaBuilder criteria, final String field, final JoinType joinType); static String getFieldNameByColumnName(final Map<String, GridComponentColumn> columns, final String columnName);  }