JsonElement getAsJsonObject - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for JsonElement getAsJsonObject method.

This code example shows how to use the following methods:getAsJsonObject, isJsonObject, has
        final Locale locale = this.fromApiJsonHelper.extractLocaleParameter(topLevelJsonElement);
 
        SingleDebitOrCreditEntryCommand[] credits = null;
        SingleDebitOrCreditEntryCommand[] debits = null;
        if (element.isJsonObject()) {
            if (topLevelJsonElement.has(JournalEntryJsonInputParams.CREDITS.getValue())
                    && topLevelJsonElement.get(JournalEntryJsonInputParams.CREDITS.getValue()).isJsonArray()) {
                credits = populateCreditsOrDebitsArray(topLevelJsonElement, locale, credits, JournalEntryJsonInputParams.CREDITS.getValue());
            } 
            if (topLevelJsonElement.has(JournalEntryJsonInputParams.DEBITS.getValue())
                    && topLevelJsonElement.get(JournalEntryJsonInputParams.DEBITS.getValue()).isJsonArray()) {
                debits = populateCreditsOrDebitsArray(topLevelJsonElement, locale, debits, JournalEntryJsonInputParams.DEBITS.getValue());
            } 
        } 
        return new JournalEntryCommand(officeId, transactionDate, comments, credits, debits);
    } 
 
    /** 
     * @param comments 
     * @param topLevelJsonElement 

5
CodeRank
This code example shows how to use the following methods:getAsJsonObject, isJsonObject, get
This code example shows how to use the following methods:getAsJsonObject, isJsonObject, get
3
CodeRank

Related JsonElement getAsJsonObject Questions & Answers:

getAsJsonObject Method Overview
convenience method to get this element as a JsonObject.
See Code Examples for other Android JsonElement Methods: