/** * Escapes a property value before it is written to disk. * * @param value the value to be escaped * @return the escaped value */ private String escapeValue(final Object value) { final String v = StringEscapeUtils.escapeXml10(String.valueOf(value)); return String.valueOf(getListDelimiterHandler().escape(v, ListDelimiterHandler.NOOP_TRANSFORMER)); }
/** * Adds the property with the specified key. This task will be delegated to * the associated {@code ExpressionEngine}, so the passed in key * must match the requirements of this implementation. * * @param key the key of the new property * @param obj the value of the new property */ @Override protected void addPropertyInternal(final String key, final Object obj) { addPropertyToModel(key, getListDelimiterHandler().parse(obj)); }
@Override protected Object getPropertyInternal(final String key) { final Object value = map.get(key); if (value instanceof String) { final Collection<String> list = getListDelimiterHandler().split((String) value, !isTrimmingDisabled()); return list.size() > 1 ? list : list.iterator().next(); } return value; }
.escapeList(values, valueTransformer)); v = String.valueOf(getDelimiterHandler().escape(value, valueTransformer));
return String.valueOf(delimiterHandler.escapeList(values, ListDelimiterHandler.NOOP_TRANSFORMER));
.escapeList(values, TRANSFORMER)); v = String.valueOf(getDelimiterHandler().escape(value, TRANSFORMER));
String.valueOf(listHandler.escapeList(list, ListDelimiterHandler.NOOP_TRANSFORMER));
/** * Escapes the given property value before it is written. This method add * quotes around the specified value if it contains a comment character and * handles list delimiter characters. * * @param value the string to be escaped */ private String escapeValue(final String value) { return String.valueOf(getListDelimiterHandler().escape( escapeComments(value), ListDelimiterHandler.NOOP_TRANSFORMER)); }
/** * Takes care of list delimiters in property values. This method checks if * delimiter parsing is enabled and the passed in value contains a delimiter * character. If this is the case, a split operation is performed. * * @param value the property value to be examined * @return the processed value */ protected Object handleDelimiters(Object value) { if (value instanceof String) { final Collection<String> values = getListDelimiterHandler().split((String) value, true); value = values.size() > 1 ? values : values.iterator().next(); } return value; } }
@Override protected Object performOperation() throws SQLException { final List<Object> results = new ArrayList<>(); try (final ResultSet rs = openResultSet(String.format(SQL_GET_PROPERTY, table, keyColumn), true, key)) { while (rs.next()) { final Object value = extractPropertyValue(rs); // Split value if it contains the list delimiter for (final Object o : getListDelimiterHandler().parse(value)) { results.add(o); } } } if (!results.isEmpty()) { return (results.size() > 1) ? results : results .get(0); } return null; } };
/** * Encodes a property value so that it can be added to this configuration. * This method deals with list delimiters. The passed in object has to be * escaped so that an add operation yields the same result. If it is a list, * all of its values have to be escaped. * * @param value the value to be encoded * @return the encoded value */ private Object encodeForCopy(final Object value) { if (value instanceof Collection) { return encodeListForCopy((Collection<?>) value); } return getListDelimiterHandler().escape(value, ListDelimiterHandler.NOOP_TRANSFORMER); }
getListDelimiterHandler().split(value, true); for (final String f : files)
/** * Actually adds a property to this configuration. This method is called by * {@code addProperty()}. It performs list splitting if necessary and * delegates to {@link #addPropertyDirect(String, Object)} for every single * property value. * * @param key the key of the property to be added * @param value the new property value * @since 2.0 */ protected void addPropertyInternal(final String key, final Object value) { for (final Object obj : getListDelimiterHandler().parse(value)) { addPropertyDirect(key, obj); } }
String.valueOf(listDelimiterHandler.escape( newNode.getValue(), ListDelimiterHandler.NOOP_TRANSFORMER));
/** * Creates the node(s) for the given key value-pair. If delimiter parsing is * enabled, the value string is split if possible, and for each single value * a node is created. Otherwise only a single node is added to the section. * * @param sectionBuilder the section builder for adding new nodes * @param key the key * @param value the value string */ private void createValueNodes(final ImmutableNode.Builder sectionBuilder, final String key, final String value) { final Collection<String> values = getListDelimiterHandler().split(value, false); for (final String v : values) { sectionBuilder.addChild(new ImmutableNode.Builder().name(key) .value(v).create()); } }
final Iterator<?> itValues = getListDelimiterHandler().parse(newValue).iterator(); final Map<QueryResult<T>, Object> changedValues = new HashMap<>();
/** * {@inheritDoc} This implementation determines the XML element * associated with the given node. Then this element's value and * attributes are set accordingly. */ @Override protected void update(final ImmutableNode node, final Object reference, final ReferenceNodeHandler refHandler) { if (XMLListReference.isListNode(node, refHandler)) { if (XMLListReference.isFirstListItem(node, refHandler)) { final String value = XMLListReference.listValue(node, refHandler, listDelimiterHandler); updateElement(node, refHandler, value); } } else { final Object value = listDelimiterHandler.escape(refHandler.getValue(node), ListDelimiterHandler.NOOP_TRANSFORMER); updateElement(node, refHandler, value); } }
values = getListDelimiterHandler().split(value, trim);