/** * <p> * XML-escapes all the elements in the target array. * </p> * * @param target the array of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a String[] with the result of each * each element of the target. * * @since 2.0.9 * */ public String[] arrayEscapeXml(final Object[] target) { if (target == null) { return null; } final String[] result = new String[target.length]; for (int i = 0; i < target.length; i++) { result[i] = escapeXml(target[i]); } return result; }
/** * <p> * XML-escapes all the elements in the target set. * </p> * * @param target the list of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a Set with the result of each * each element of the target. * * @since 2.0.9 * */ public Set<String> setEscapeXml(final Set<?> target) { if (target == null) { return null; } final Set<String> result = new LinkedHashSet<String>(target.size() + 2); for (final Object element : target) { result.add(escapeXml(element)); } return result; }
/** * <p> * XML-escapes all the elements in the target list. * </p> * * @param target the list of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a List with the result of each * each element of the target. * * @since 2.0.9 * */ public List<String> listEscapeXml(final List<?> target) { if (target == null) { return null; } final List<String> result = new ArrayList<String>(target.size() + 2); for (final Object element : target) { result.add(escapeXml(element)); } return result; }
/** * <p> * XML-escapes all the elements in the target array. * </p> * * @param target the array of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a String[] with the result of each * each element of the target. * * @since 2.0.9 * */ public String[] arrayEscapeXml(final Object[] target) { if (target == null) { return null; } final String[] result = new String[target.length]; for (int i = 0; i < target.length; i++) { result[i] = escapeXml(target[i]); } return result; }
/** * <p> * XML-escapes all the elements in the target list. * </p> * * @param target the list of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a List with the result of each * each element of the target. * * @since 2.0.9 * */ public List<String> listEscapeXml(final List<?> target) { if (target == null) { return null; } final List<String> result = new ArrayList<String>(target.size() + 2); for (final Object element : target) { result.add(escapeXml(element)); } return result; }
/** * <p> * XML-escapes all the elements in the target set. * </p> * * @param target the list of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a Set with the result of each * each element of the target. * * @since 2.0.9 * */ public Set<String> setEscapeXml(final Set<?> target) { if (target == null) { return null; } final Set<String> result = new LinkedHashSet<String>(target.size() + 2); for (final Object element : target) { result.add(escapeXml(element)); } return result; }