From: Niels Erik G. Nielsen Date: Fri, 31 May 2013 14:31:33 +0000 (-0400) Subject: Renames method. Javadoc. X-Git-Tag: v0.0.7~68 X-Git-Url: http://git.indexdata.com/?p=mkjsf-moved-to-github.git;a=commitdiff_plain;h=7798305712558ae5e3d5ae947e6f99a1132735bc Renames method. Javadoc. --- diff --git a/src/main/java/com/indexdata/mkjsf/utils/UiUtils.java b/src/main/java/com/indexdata/mkjsf/utils/UiUtils.java index d6ffe2c..c5cd943 100644 --- a/src/main/java/com/indexdata/mkjsf/utils/UiUtils.java +++ b/src/main/java/com/indexdata/mkjsf/utils/UiUtils.java @@ -55,10 +55,17 @@ public class UiUtils { * @param string * @return */ - public static String quotes(String string) { + public static String quote(String string) { return "\"" + string + "\""; } + /** + * Gets at most maxElements elements of the given elementName + * @param container The parent element containing the elements to retrieve + * @param elementName The name of the element(s) to retrieve + * @param maxElements Maximum number of elements to retrieve + * @return At most maxElements data objects of the given type + */ public static List getMaxNumElements(ResponseDataObject container, String elementName, int maxElements) { if (container.getElements(elementName)!=null) { int elementCount = container.getElements(elementName).size(); @@ -69,6 +76,17 @@ public class UiUtils { return container.getElements(elementName); } + /** + * Gets at most maxElements data objects, up to a total string length of maxTotalValueLength + * @param container The parent element containing the elements to retrieve + * @param elementName The name of the element(s) to retrieve + * @param maxElements Maximum number of elements to retrieve + * @param maxTotalValueLength The maximum total string length of the values of the elements retrieved + * @param hardLimit If set to true, the list will be cut of at or below the total string length, if false, the list + * will contain the first element that exceeds the length limit - for instance thus guaranteeing + * that at least one of the elements will be returned, no matter it's length. + * @return Delimited list of elements + */ public List getMaxElements(ResponseDataObject container, String elementName, int maxElements, int maxTotalValueLength, boolean hardLimit) { List maxNumList = getMaxNumElements(container,elementName,maxElements); if (maxNumList!=null) {