public String getValue() {
return unescape(value);
}
-
+
+ /**
+ * Change the value of this {@link Data}
+ *
+ * @param value
+ * the new value
+ */
+ public void setValue(String value) {
+ setRawValue(escape(value));
+ }
+
/**
- * Return the RAW value of this {@link Data}
+ * Return the raw value of this {@link Data}
*
- * @return the RAW value
+ * @return the raw value
*/
public String getRawValue() {
return value;
}
/**
- * Change the value of this {@link Data}
+ * Change the raw value of this {@link Data}
*
* @param value
- * the new value
+ * the new raw value
*/
- public void setValue(String value) {
- value = escape(value);
-
+ public void setRawValue(String value) {
if ((value == null && this.value != null)
|| (value != null && !value.equals(this.value))) {
this.value = value;
for (int i = 0; i < value.length(); i++) {
if (value.charAt(i) == sep
&& (i == 0 || value.charAt(i - 1) != '\\')) {
- rep.add(value.substring(last, i - last));
+ rep.add(value.substring(last, i));
+ last = i + 1;
}
}
- rep.add(value.substring(last));
+ if (last < value.length())
+ rep.add(value.substring(last));
}
return rep;