Package de.xima.fc.gui.utils.data
Class QueryUtils
java.lang.Object
de.xima.fc.gui.utils.data.QueryUtils
Utility class providing methods for handling data queries
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptionstatic final StringformatBold(String original, String bold) Turns sub strings within the original boldstatic final StringgenerateUrl(Mandant client, EDatenabfrageTyp type, String queryName, List<IParameterModel> params) static final StringgenreateUrl(Datenquelle source) Generate the servlet URL for the given sourcestatic final String[]getNonEmptyArray(List<GenericStringModel> strings) static final Serializable[]getParameterValueArray(List<IParameterModel> parameters) Generates an array from the given list of parameters containing the parameter valuesstatic final org.primefaces.model.TreeNode<Object>getTreeNode(com.alibaba.fastjson.JSONArray jsonArray, Object data) Generates aTreeNodefrom the givenJSONArraystatic final org.primefaces.model.TreeNode<Object>getTreeNode(com.alibaba.fastjson.JSONObject jsonObject, Object data) Generates aTreeNodefrom the givenJSONObjectstatic final org.primefaces.model.TreeNode<Object>getTreeNode(com.alibaba.fastjson.JSON json, Object data) Generates aTreeNodefrom the givenJSONstatic 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 queryStringstatic final 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 Details
-
getParameterValueArray
Generates an array from the given list of parameters containing the parameter values- Parameters:
parameters-ListofIParameterModels- Returns:
- an array of the parameter values
-
getNonEmptyArray
- Parameters:
strings-ListofGenericStringModels- Returns:
Stringarray
-
replaceWithNumbers
replaces all occurrences of a given substring in the originalStringwith running numbers -
formatBold
Turns sub strings within the original bold -
getTreeNode
public static final org.primefaces.model.TreeNode<Object> 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<Object> 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<Object> 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
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)
-