public void readApiVersions() throws Exception {
        current = nextToken();
        if (current == JsonToken.END_ARRAY) {
            return;
        }
        while (nextToken() != JsonToken.END_ARRAY) {
            // Traverse each api definition
            while(nextToken() != JsonToken.END_OBJECT) {
                if (jp.getCurrentName().equals(ApiVersionBean.class.getSimpleName())) {
                    current = nextToken();
                    ApiVersionBean apiBean = jp.readValueAs(ApiVersionBean.class);
                    dispatcher.apiVersion(apiBean);
                } else {
                    OrgElementsEnum fieldName = OrgElementsEnum.valueOf(jp.getCurrentName());
                    current = nextToken();
                    switch (fieldName) {
                        case Policies:
                            processEntities(PolicyBean.class, dispatcher::apiPolicy);
                            break;
                        case ApiDefinition:
                            byte[] schema = jsonParser().getBinaryValue();
                            if (schema != null && schema.length > 0) {
                                dispatcher.apiDefinition(new ByteArrayInputStream(schema));
                            }
                            break;
                        default:
                            throw new RuntimeException("Unhandled entity " + fieldName + " with token " + current);
                    }
                }
            }
        }
    }
@see io.apiman.manager.api.exportimport.read.IImportReader#setDispatcher(io.apiman.manager.api.exportimport.read.IImportReaderDispatcher)
manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/json/JsonImportReader.java