Code example for JsonReader

Methods: nextName

0
 
public class ConfigurationHelper { 
	 
	private static void validateJsonName(JsonReader reader, String name)
			throws IOException { 
		if (!reader.nextName().equals(name))
			throw new IOException("Illegal JSON format!");
	} 
	 
	public static Configuration readFromJsonFile(File file) throws IOException {
		return readFromJsonFile(file, null);
	} 
	 
	public static Configuration readFromJsonFile(File file,
			EncryptionCallback encryptionCallback) throws IOException {
		FileReader fileReader = new FileReader(file);
		JsonReader reader = new JsonReader(fileReader);
		 
		Configuration configuration;
		Encryption encryption;