Package de.xima.fc.gui.utils.data
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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringformatBold(String original, String bold)Turns sub strings within the original boldstatic StringgenerateUrl(Mandant client, EDatenabfrageTyp type, String queryName, List<IParameterModel> params)static StringgenreateUrl(Datenquelle source)Generate the servlet URL for the given sourcestatic String[]getNonEmptyArray(List<GenericStringModel> strings)static Serializable[]getParameterValueArray(List<IParameterModel> parameters)Generates an array from the given list of parameters containing the parameter valuesstatic org.primefaces.model.TreeNodegetTreeNode(com.alibaba.fastjson.JSONArray jsonArray, Object data)Generates aTreeNodefrom the givenJSONArraystatic org.primefaces.model.TreeNodegetTreeNode(com.alibaba.fastjson.JSONObject jsonObject, Object data)Generates aTreeNodefrom the givenJSONObjectstatic org.primefaces.model.TreeNodegetTreeNode(com.alibaba.fastjson.JSON json, Object data)Generates aTreeNodefrom the givenJSONstatic List<IParameterModel>getUpdatedParameters(List<IParameterModel> params, String query, String placeholder)Updates the given list of parameters if new parameters have been added to the queryStringstatic StringreplaceWithNumbers(String original, String replaceString, int start)replaces all occurrences of a given substring in the originalStringwith running numbersstatic StringsetParamValues(String original, String replaceStr, List<IParameterModel> params, boolean withQuotes)Replaces all occurrences of the placeholder with the consecutive values of the parameter list 
 - 
 
- 
- 
Method Detail
- 
getParameterValueArray
public static final Serializable[] getParameterValueArray(List<IParameterModel> parameters)
Generates an array from the given list of parameters containing the parameter values- Parameters:
 parameters-ListofIParameterModels- Returns:
 - an array of the parameter values
 
 
- 
getNonEmptyArray
public static final String[] getNonEmptyArray(List<GenericStringModel> strings)
- Parameters:
 strings-ListofGenericStringModels- Returns:
 Stringarray
 
- 
replaceWithNumbers
public static final String replaceWithNumbers(String original, String replaceString, int start)
replaces all occurrences of a given substring in the originalStringwith running numbers 
- 
formatBold
public static final String formatBold(String original, String bold)
Turns sub strings within the original bold 
- 
getTreeNode
public static final org.primefaces.model.TreeNode getTreeNode(com.alibaba.fastjson.JSON json, Object data)Generates aTreeNodefrom the givenJSON- Parameters:
 json-JSONcontaining tree information- Returns:
 TreeNodeof the givenJSON
 
- 
getTreeNode
public static final org.primefaces.model.TreeNode getTreeNode(com.alibaba.fastjson.JSONArray jsonArray, Object data)Generates aTreeNodefrom the givenJSONArray- Parameters:
 jsonArray-JSONArraycontaining tree information- Returns:
 TreeNodeof the givenJSONArray
 
- 
getTreeNode
public static final org.primefaces.model.TreeNode getTreeNode(com.alibaba.fastjson.JSONObject jsonObject, Object data)Generates aTreeNodefrom the givenJSONObject- Parameters:
 jsonObject-JSONObjectcontaining tree information- Returns:
 TreeNodeof the givenJSONObject
 
- 
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 queryString- Parameters:
 params-ListofIParameterModelsquery-Stringplaceholder-Stringfor the parameters within the query- Returns:
 - updated 
Listof 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 
- 
genreateUrl
public static final String genreateUrl(Datenquelle source)
Generate the servlet URL for the given source- Parameters:
 source-Datenquelleto generate servlet URL for- Returns:
 Stringservlet URL- Throws:
 NullPointerException- if source isnullIllegalArgumentException- if ID of source is invalid
 
- 
generateUrl
public static final String generateUrl(Mandant client, EDatenabfrageTyp type, String queryName, List<IParameterModel> params)
 
 - 
 
 -