0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Json文字列の変換

Posted at

元の質問 : List>をapex:pageBlockTableで表示させる

今回のポイントはdeserializeStrictの中でList変数として呼び出しているところだ。
こんな使い方ができるとは思ってなかった...

    public static void test002() {
        
        String theJsonString = '[{"id":1, "name":"Abc_SS", "description":"Abc", "address":"Abc"}, {"id":2, "name":"sales", "description":"sales", "address":"Abc"}]';
        
        LIST<JsonTestClass> JyuhatyuList = (LIST<JsonTestClass>)JSON.deserializeStrict(theJsonString,LIST<JsonTestClass>.class);//Json-->Object
        system.debug(Logginglevel.INFO,' === JyuhatyuList ==>>  '+ JyuhatyuList );
        
    }
    
    
    public class JsonTestClass {
        public String id;
        public String name;
        public String description;
        public String address;
    }
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?