code: private int parseObject() throws Exception {
          int elementsWritten = 0;
          while (jsonParser.nextToken() != null && jsonParser.getCurrentToken() != END_OBJECT) {
              if (FIELD_NAME.equals(jsonParser.getCurrentToken())) {
                  String elementName = convertName(jsonParser.getCurrentName());
                  //jump to element value
                  jsonParser.nextToken();
                  startElement(elementName);
                  parseElement(elementName, false);
                  endElement(elementName);
                  elementsWritten++;
              } else {
                  throw new ParserException("Error when parsing. Expected field name got " + jsonParser.getCurrentToken());
              }
          }
          return elementsWritten;
      }
docs: Parses generic object.
  
  @return number of elements written
  @throws IOException
  @throws JsonParseException
  @throws Exception