@Override
    public Element[] deserialize(final JsonElement json, final Type typeOfT,
                                 final JsonDeserializationContext context) {

        final Element[] elements;

        if (json.isJsonObject()) {
            elements = new Element[json.getAsJsonObject().entrySet().size()];
            int i = 0;
            for (final Entry<String, JsonElement> elem : json.getAsJsonObject().entrySet()) {
                elements[i] = new Element();
                elements[i].setKey(elem.getKey());
                elements[i].setValue(elem.getValue().getAsString());
                i++;
            }
        } else {
            throw new JsonParseException("Unexpected data: " + json.toString());
        }
        return elements;
    }
@ Override public Element [ ] deserialize ( final JsonElement json , final Type typeOfT , final JsonDeserializationContext context ) { final Element [ ] elements ; if ( json . isJsonObject ( ) ) { elements = new Element [ json . getAsJsonObject ( ) . entrySet ( ) . size ( ) ] ; int i = 0 ; for ( final Entry < String , JsonElement > elem : json . getAsJsonObject ( ) . entrySet ( ) ) { elements [ i ] = new Element ( ) ; elements [ i ] . setKey ( elem . getKey ( ) ) ; elements [ i ] . setValue ( elem . getValue ( ) . getAsString ( ) ) ; i ++ ; } } else { throw new JsonParseException ( "Unexpected data: " + json . toString ( ) ) ; } return elements ; }
{@inheritDoc}

@see com.google.gson.JsonDeserializer#deserialize(com.google.gson.JsonElement,
java.lang.reflect.Type, com.google.gson.JsonDeserializationContext)