に地図<文字列、文字列>の変換私はこのようなJavaでMap<String,String>
を持っている:JSON
{card_switch=Master, issuing_bank=ICCI, card_Type=DebitCard}
私はJSONオブジェクトには、このマップを解析するsimple json parserを使用しています。
私が試した:
Object json = JSONValue.parse(entry.getKey());
をしかし、私はエラーメッセージが表示されます:
Object json = JSONValue.parse(entry.getKey());
^
method JSONValue.parse(String) is not applicable
(actual argument Map<String,String> cannot be converted to String by method invocation conversion)
method JSONValue.parse(Reader) is not applicable
(actual argument Map<String,String> cannot be converted to Reader by method invocation conversion)
は、可能なJSONにMap<String,String>
を変換することですか?
はGSON http://code.google.com/p/google-gson/ – Abubakkar
このページの例1.4を見てください、あなたが疲れてい.google.com/p/json-simple/wiki/EncodingExamples#Example_1-4 _-_ Encode_a_JSON_object _-_ Using_Map_and_streaming –