/** * Returns a configured default value if specified value is null. * @param checkMe object to check * @return a configured default value if the specified value is null. */ public Object alt(Object checkMe) { return alt(checkMe, this.defaultAlternate); }
/** * Truncates or pads the string value of the specified object as necessary * to ensure that the returned string's length equals the specified cell size. * @param obj the value to be put in the 'cell' * @param cellsize the size of the cell into which the object must be placed * @return truncated/padded string */ public String cell(Object obj, int cellsize) { return cell(obj, cellsize, this.defaultCellSuffix); }
/** * Formats a collection or array into the form "A, B and C". * * @param list A collection or array. * @return A String. */ public String list(Object list) { return list(list, this.defaultDelim, this.defaultFinalDelim); }
if (listDelim != null) setListDelimiter(listDelim); if (listFinalDelim != null) setListFinalDelimiter(listFinalDelim); if (truncateLength != null) setTruncateLength(truncateLength); if (truncateSuffix != null) setTruncateSuffix(truncateSuffix); if (truncateAtWord != null) setTruncateAtWord(truncateAtWord); setCellLength(cellLength); setCellSuffix(cellSuffix); setDefaultAlternate(defaultAlternate); setAllowedTags(allowedTags);
DisplayTool displayTool = new DisplayTool(); displayTool.configure(toolConfig); context.put("display", displayTool);
/** * Builds plural form of a passed word if 'value' is plural, otherwise * returns 'singular'. Plural form is built using some basic English * language rules for nouns which does not guarantee correct syntax of a * result in all cases. * @param value count * @param singular Singular form of a word. * @return guessed plural */ public String plural(int value, String singular) { return plural(value, singular, null); }
return String.format(getLocale(), format, args);
sb.append(getProperty(iterator.next(), property));
/** * Truncates or pads the string value of the specified object as necessary * to ensure that the returned string's length equals the default cell size. * @param obj the value to be put in the 'cell' * @return truncated/padded string */ public String cell(Object obj) { return cell(obj, this.defaultCellLength); }
/** * Formats a collection or array into the form * "A<delim>B<delim>C". * * @param list A collection or array. * @param delim A String. * @return A String. */ public String list(Object list, String delim) { return list(list, delim, delim); }
/** * Truncates or pads the string value of the specified object as necessary * to ensure that the returned string's length equals the default cell size. * If truncation is necessary, the specified suffix will replace the end of * the string value to indicate that. * @param obj the value to be put in the 'cell' * @param suffix the suffix to put at the end of any values that need truncating * to indicate that they've been truncated * @return truncated/padded string */ public String cell(Object obj, String suffix) { return cell(obj, this.defaultCellLength, suffix); }
/** * Formats a collection or array into the form * "A<delim>B<finaldelim>C". * * @param list A collection or array. * @param delim A String. * @param finaldelim A String. * @return A String. */ public String list(Object list, String delim, String finaldelim) { return list(list, delim, finaldelim, null); }