Back to project page wherewithal.
The source code is released under:
GNU General Public License
If you think the Android project wherewithal listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.curchod.json; /* w w w.j av a 2s . c o m*/ import java.net.URI; /** * Create a JSON object based on the TinCan API with the following structure: * * "object": "id": "http://en.wiktionary.org/wiki/cat", "objectType": "Activity", "definition": "name": "ko-KR": "?????" "description": ??Reading?? "type": "http://ko.wiktionary.org/wiki/?????" * @author user * */ public class VocabularyLearningObject { private URI id; private String objectType; private VocabularyDefinition definition; public void setId(URI _id) { this.id = _id; } public URI getId() { return this.id; } public void setObjectType(String _objectType) { this.objectType = _objectType; } public String getObjectType() { return this.objectType; } public void setDefintion(VocabularyDefinition _definition) { this.definition = _definition; } public VocabularyDefinition getDefinition() { return this.definition; } public String toJSON() { StringBuffer buffer = new StringBuffer(); buffer.append("\"object\":"); buffer.append("\"id\": \""+id.toString()+"\","); buffer.append("\"objectType\": \""+objectType+"\","); buffer.append("\"definition\":"); buffer.append("\"name\": \"" +definition.getNameLocale()+"\": \"" +definition.getNameValue()+"\","); buffer.append("\"description\": \""+definition.getDescription()+"\","); buffer.append("\"type\": \""+definition.getType()+""); return buffer.toString(); } }