All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minidev.json.parser.ContainerFactory Maven / Gradle / Ivy

Go to download

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.

There is a newer version: 1.3.2
Show newest version
package net.minidev.json.parser;

import java.util.List;
import java.util.Map;

import net.minidev.json.JSONArray;
import net.minidev.json.JSONObject;
import net.minidev.json.parser.ContainerFactory;

/**
 * Container factory for creating containers for JSON object and JSON array.
 *
 * @author FangYidong
 */
public class ContainerFactory {
	public final static ContainerFactory FACTORY = new ContainerFactory();
	
	/**
	 * @return A Map instance to store JSON object, or null if you want to use JSONObject.
	 */
	public Map createObjectContainer() {
		return new JSONObject();
	}
	
	/**
	 * @return A List instance to store JSON array, or null if you want to use JSONArray. 
	 */
	public List creatArrayContainer() {
		return new JSONArray();
	}
}