Project

General

Profile

1
/**
2
 * 
3
 */
4
package eu.dnetlib.data.collective.transformation;
5

    
6
import java.beans.PropertyEditorSupport;
7

    
8
import org.svenson.JSONParser;
9

    
10
/**
11
 * @author js
12
 *
13
 */
14
public class VocabularyTypeEditor extends PropertyEditorSupport {
15

    
16
	/**
17
	 * Sets the property value by parsing the given JsonString. May raise java.lang.IllegalArgumentException if either the String is badly formatted or if this kind of property can't be expressed as text.
18
	 * @see java.beans.PropertyEditorSupport#setAsText(java.lang.String)
19
	 */
20
	@Override
21
	public void setAsText(String aJsonString) throws IllegalArgumentException {
22
		VocabularyMap map = JSONParser.defaultJSONParser().parse(VocabularyMap.class, aJsonString);
23
		setValue(map);
24
	}
25
}
(5-5/5)