Exemplo n.º 1
0
 public void startObject() {
   if (current == null) {
     current = new ObjectValue();
     values.push(current);
     return;
   }
   ObjectValue o = new ObjectValue();
   if (current.isObject()) {
     current.addElement(key, o);
   } else if (current.isArray()) {
     current.addElement(o);
   }
   values.push(current);
   current = o;
 }
Exemplo n.º 2
0
 public void startArray() {
   ArrayValue o = new ArrayValue();
   if (current == null) {
     current = o;
   } else if (current.isObject()) {
     current.addElement(key, o);
   } else if (current.isArray()) {
     current.addElement(o);
   }
   values.push(current);
   current = o;
 }
Exemplo n.º 3
0
 /** Reset JSON events handler and prepare it for next usage. */
 public void reset() {
   current = null;
   key = null;
   values.clear();
 }
Exemplo n.º 4
0
 public void endObject() {
   current = values.pop();
 }
Exemplo n.º 5
0
 public void endArray() {
   current = values.pop();
 }