Class QueryUtils

java.lang.Object
de.xima.fc.gui.utils.data.QueryUtils

public class QueryUtils extends Object
Utility class providing methods for handling data queries
Author:
XIMA MEDIA GmbH
  • Method Details

    • getParameterValueArray

      public static final Serializable[] getParameterValueArray(List<IParameterModel> parameters)
      Generates an array from the given list of parameters containing the parameter values
      Parameters:
      parameters - List of IParameterModels
      Returns:
      an array of the parameter values
    • getNonEmptyArray

      public static final String[] getNonEmptyArray(List<GenericStringModel> strings)
      Generates a String array from the given List of GenericStringModel skipping empty values
      Parameters:
      strings - List of GenericStringModels
      Returns:
      String array
    • replaceWithNumbers

      public static final String replaceWithNumbers(String original, String replaceString, int start)
      replaces all occurrences of a given substring in the original String with running numbers
      Parameters:
      original - String that should be altered
      replaceString - String that should be replaced
      start - from where the running numbers should start
      Returns:
      String with replaced substrings
    • formatBold

      public static final String formatBold(String original, String bold)
      Turns sub strings within the original bold
      Parameters:
      original - String
      bold - String to be made bold within the original string
      Returns:
      String of original with bold sub strings
    • getTreeNode

      public static final org.primefaces.model.TreeNode<Object> getTreeNode(com.alibaba.fastjson.JSON json, Object data)
      Generates a TreeNode from the given JSON
      Parameters:
      json - JSON containing tree information
      Returns:
      TreeNode of the given JSON
    • getTreeNode

      public static final org.primefaces.model.TreeNode<Object> getTreeNode(com.alibaba.fastjson.JSONArray jsonArray, Object data)
      Generates a TreeNode from the given JSONArray
      Parameters:
      jsonArray - JSONArray containing tree information
      Returns:
      TreeNode of the given JSONArray
    • getTreeNode

      public static final org.primefaces.model.TreeNode<Object> getTreeNode(com.alibaba.fastjson.JSONObject jsonObject, Object data)
      Generates a TreeNode from the given JSONObject
      Parameters:
      jsonObject - JSONObject containing tree information
      Returns:
      TreeNode of the given JSONObject
    • getUpdatedParameters

      public static final List<IParameterModel> getUpdatedParameters(List<IParameterModel> params, String query, String placeholder)
      Updates the given list of parameters if new parameters have been added to the query String
      Parameters:
      params - List of IParameterModels
      query - String
      placeholder - String for the parameters within the query
      Returns:
      updated List of parameters
    • setParamValues

      public static String setParamValues(String original, String replaceStr, List<IParameterModel> params, boolean withQuotes)
      Replaces all occurrences of the placeholder with the consecutive values of the parameter list
      Parameters:
      original - String
      replaceStr - String to be replaced by the parameter values
      params - List parameter list containing values to be input into original string
      Returns:
      the String with replaces placeholder
    • genreateUrl

      public static final String genreateUrl(Datenquelle source)
      Generate the servlet URL for the given source
      Parameters:
      source - Datenquelle to generate servlet URL for
      Returns:
      String servlet URL
      Throws:
      NullPointerException - if source is null
      IllegalArgumentException - if ID of source is invalid
    • generateUrl

      public static final String generateUrl(Mandant client, EDatenabfrageTyp type, String queryName, List<IParameterModel> params)