}
@Override
@SuppressWarnings("unchecked")
public void setAsText(String text) throws IllegalArgumentException {
PlayList docs = (PlayList) getValue();
if (docs == null) docs = new PlayList();
for (String doc : text.split("##")) {
if (StringUtils.hasText(doc)) {
if (doc.startsWith("-")) {
Iterator<Audio> it = docs.getPlayList().iterator();
while (it.hasNext()) {
Audio d = it.next();
if (doc.substring(1).equals(d.getUri())) it.remove();
}
} else {
Audio document = getAudio(doc);
if (document != null) docs.addAudio(document);
}
}
}
setValue(docs);
}