public static List < String > parseAttachmentNames ( JsonParser documentJsonParser ) throws IOException { documentJsonParser . nextToken ( ) ; JsonToken jsonToken ; while ( ( jsonToken = documentJsonParser . nextToken ( ) ) != JsonToken . END_OBJECT ) { if ( CouchDbDocument . ATTACHMENTS_NAME . equals ( documentJsonParser . getCurrentName ( ) ) ) { return readAttachments ( documentJsonParser ) ; } else if ( jsonToken == JsonToken . START_OBJECT ) { readIgnoreObject ( documentJsonParser ) ; } } return null ; }
Parses a CouchDB document in the form of a JsonParser to get the attachments order . It is important that the JsonParser come straight from the source document and not from an object or the order will be incorrect .