There's no rule that says you can't use a built-in List object, if your JSON is formatted that way:
public class BatchInsert implements Database.Batchable<Object> {
public String jsonString;
public Object[] start(Database.BatchableContext context) {
return (Object[])JSON.deserializeUntyped(jsonString);
}
public void execute(Database.BatchableContext context, Object[] scope) {
// Do stuff here
}
public void finish(Database.BatchableContext context) {
}
}
Or, if you have a wrapper class somewhere:
public class BatchInsert implements Database.Batchable<Wrapper> {
public string jsonString;
public Object[] start(Database.BatchableContext context) {
return (Wrapper[])JSON.deserialize(jsonString, List<Wrapper>.class);
}
public void execute(Database.BatchableContext context, Wrapper[] scope) {
// Do stuff here
}
public void finish(Database.BatchableContext context) {
}
}
You could also use a custom iterator. However, this would involve using JSONParser, which isn't particularly friendly even when you know what you're doing. I can't think of any good reason to use JSONParser, except maybe if you happen to have found some existing Java source that would be compatible. JSON.deserializeUntyped is just as efficient and involves a lot less work.