Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7473 vikram.rag 1
 
2
package com.amazonservices.mws.orders.model;
3
 
4
import javax.xml.bind.annotation.XmlAccessType;
5
import javax.xml.bind.annotation.XmlAccessorType;
6
import javax.xml.bind.annotation.XmlElement;
7
import javax.xml.bind.annotation.XmlRootElement;
8
import javax.xml.bind.annotation.XmlSchemaType;
9
import javax.xml.bind.annotation.XmlType;
10
import javax.xml.datatype.XMLGregorianCalendar;
11
 
12
 
13
/**
14
 * <p>Java class for anonymous complex type.
15
 * 
16
 * <p>The following schema fragment specifies the expected content contained within this class.
17
 * 
18
 * <pre>
19
 * &lt;complexType>
20
 *   &lt;complexContent>
21
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
22
 *       &lt;sequence>
23
 *         &lt;element name="SellerId" type="{http://www.w3.org/2001/XMLSchema}string"/>
24
 *         &lt;element name="CreatedAfter" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
25
 *         &lt;element name="CreatedBefore" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
26
 *         &lt;element name="LastUpdatedAfter" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
27
 *         &lt;element name="LastUpdatedBefore" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
28
 *         &lt;element name="OrderStatus" type="{https://mws.amazonservices.com/Orders/2011-01-01}OrderStatusList" minOccurs="0"/>
29
 *         &lt;element name="MarketplaceId" type="{https://mws.amazonservices.com/Orders/2011-01-01}MarketplaceIdList"/>
30
 *         &lt;element name="FulfillmentChannel" type="{https://mws.amazonservices.com/Orders/2011-01-01}FulfillmentChannelList" minOccurs="0"/>
31
 *         &lt;element name="PaymentMethod" type="{https://mws.amazonservices.com/Orders/2011-01-01}PaymentMethodList" minOccurs="0"/>
32
 *         &lt;element name="BuyerEmail" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
33
 *         &lt;element name="SellerOrderId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
34
 *         &lt;element name="MaxResultsPerPage" type="{https://mws.amazonservices.com/Orders/2011-01-01}MaxResults" minOccurs="0"/>
35
 *         &lt;element name="TFMShipmentStatus" type="{https://mws.amazonservices.com/Orders/2011-01-01}TFMShipmentStatusList" minOccurs="0"/>
36
 *       &lt;/sequence>
37
 *     &lt;/restriction>
38
 *   &lt;/complexContent>
39
 * &lt;/complexType>
40
 * </pre>
41
 * 
42
 * 
43
 */
44
@XmlAccessorType(XmlAccessType.FIELD)
45
@XmlType(name = "", propOrder = {
46
    "sellerId",
47
    "createdAfter",
48
    "createdBefore",
49
    "lastUpdatedAfter",
50
    "lastUpdatedBefore",
51
    "orderStatus",
52
    "marketplaceId",
53
    "fulfillmentChannel",
54
    "paymentMethod",
55
    "buyerEmail",
56
    "sellerOrderId",
57
    "maxResultsPerPage",
58
    "tfmShipmentStatus"
59
})
60
@XmlRootElement(name = "ListOrdersRequest")
61
public class ListOrdersRequest {
62
 
63
    @XmlElement(name = "SellerId", required = true)
64
    protected String sellerId;
65
    @XmlElement(name = "CreatedAfter")
66
    @XmlSchemaType(name = "dateTime")
67
    protected XMLGregorianCalendar createdAfter;
68
    @XmlElement(name = "CreatedBefore")
69
    @XmlSchemaType(name = "dateTime")
70
    protected XMLGregorianCalendar createdBefore;
71
    @XmlElement(name = "LastUpdatedAfter")
72
    @XmlSchemaType(name = "dateTime")
73
    protected XMLGregorianCalendar lastUpdatedAfter;
74
    @XmlElement(name = "LastUpdatedBefore")
75
    @XmlSchemaType(name = "dateTime")
76
    protected XMLGregorianCalendar lastUpdatedBefore;
77
    @XmlElement(name = "OrderStatus")
78
    protected OrderStatusList orderStatus;
79
    @XmlElement(name = "MarketplaceId", required = true)
80
    protected MarketplaceIdList marketplaceId;
81
    @XmlElement(name = "FulfillmentChannel")
82
    protected FulfillmentChannelList fulfillmentChannel;
83
    @XmlElement(name = "PaymentMethod")
84
    protected PaymentMethodList paymentMethod;
85
    @XmlElement(name = "BuyerEmail")
86
    protected String buyerEmail;
87
    @XmlElement(name = "SellerOrderId")
88
    protected String sellerOrderId;
89
    @XmlElement(name = "MaxResultsPerPage")
90
    protected Integer maxResultsPerPage;
91
    @XmlElement(name = "TFMShipmentStatus")
92
    protected TFMShipmentStatusList tfmShipmentStatus;
93
 
94
    /**
95
     * Default constructor
96
     * 
97
     */
98
    public ListOrdersRequest() {
99
        super();
100
    }
101
 
102
    /**
103
     * Value constructor
104
     * 
105
     */
106
    public ListOrdersRequest(final String sellerId, final XMLGregorianCalendar createdAfter, final XMLGregorianCalendar createdBefore, final XMLGregorianCalendar lastUpdatedAfter, final XMLGregorianCalendar lastUpdatedBefore, final OrderStatusList orderStatus, final MarketplaceIdList marketplaceId, final FulfillmentChannelList fulfillmentChannel, final PaymentMethodList paymentMethod, final String buyerEmail, final String sellerOrderId, final Integer maxResultsPerPage, final TFMShipmentStatusList tfmShipmentStatus) {
107
        this.sellerId = sellerId;
108
        this.createdAfter = createdAfter;
109
        this.createdBefore = createdBefore;
110
        this.lastUpdatedAfter = lastUpdatedAfter;
111
        this.lastUpdatedBefore = lastUpdatedBefore;
112
        this.orderStatus = orderStatus;
113
        this.marketplaceId = marketplaceId;
114
        this.fulfillmentChannel = fulfillmentChannel;
115
        this.paymentMethod = paymentMethod;
116
        this.buyerEmail = buyerEmail;
117
        this.sellerOrderId = sellerOrderId;
118
        this.maxResultsPerPage = maxResultsPerPage;
119
        this.tfmShipmentStatus = tfmShipmentStatus;
120
    }
121
 
122
    /**
123
     * Gets the value of the sellerId property.
124
     * 
125
     * @return
126
     *     possible object is
127
     *     {@link String }
128
     *     
129
     */
130
    public String getSellerId() {
131
        return sellerId;
132
    }
133
 
134
    /**
135
     * Sets the value of the sellerId property.
136
     * 
137
     * @param value
138
     *     allowed object is
139
     *     {@link String }
140
     *     
141
     */
142
    public void setSellerId(String value) {
143
        this.sellerId = value;
144
    }
145
 
146
    public boolean isSetSellerId() {
147
        return (this.sellerId!= null);
148
    }
149
 
150
    /**
151
     * Gets the value of the createdAfter property.
152
     * 
153
     * @return
154
     *     possible object is
155
     *     {@link XMLGregorianCalendar }
156
     *     
157
     */
158
    public XMLGregorianCalendar getCreatedAfter() {
159
        return createdAfter;
160
    }
161
 
162
    /**
163
     * Sets the value of the createdAfter property.
164
     * 
165
     * @param value
166
     *     allowed object is
167
     *     {@link XMLGregorianCalendar }
168
     *     
169
     */
170
    public void setCreatedAfter(XMLGregorianCalendar value) {
171
        this.createdAfter = value;
172
    }
173
 
174
    public boolean isSetCreatedAfter() {
175
        return (this.createdAfter!= null);
176
    }
177
 
178
    /**
179
     * Gets the value of the createdBefore property.
180
     * 
181
     * @return
182
     *     possible object is
183
     *     {@link XMLGregorianCalendar }
184
     *     
185
     */
186
    public XMLGregorianCalendar getCreatedBefore() {
187
        return createdBefore;
188
    }
189
 
190
    /**
191
     * Sets the value of the createdBefore property.
192
     * 
193
     * @param value
194
     *     allowed object is
195
     *     {@link XMLGregorianCalendar }
196
     *     
197
     */
198
    public void setCreatedBefore(XMLGregorianCalendar value) {
199
        this.createdBefore = value;
200
    }
201
 
202
    public boolean isSetCreatedBefore() {
203
        return (this.createdBefore!= null);
204
    }
205
 
206
    /**
207
     * Gets the value of the lastUpdatedAfter property.
208
     * 
209
     * @return
210
     *     possible object is
211
     *     {@link XMLGregorianCalendar }
212
     *     
213
     */
214
    public XMLGregorianCalendar getLastUpdatedAfter() {
215
        return lastUpdatedAfter;
216
    }
217
 
218
    /**
219
     * Sets the value of the lastUpdatedAfter property.
220
     * 
221
     * @param value
222
     *     allowed object is
223
     *     {@link XMLGregorianCalendar }
224
     *     
225
     */
226
    public void setLastUpdatedAfter(XMLGregorianCalendar value) {
227
        this.lastUpdatedAfter = value;
228
    }
229
 
230
    public boolean isSetLastUpdatedAfter() {
231
        return (this.lastUpdatedAfter!= null);
232
    }
233
 
234
    /**
235
     * Gets the value of the lastUpdatedBefore property.
236
     * 
237
     * @return
238
     *     possible object is
239
     *     {@link XMLGregorianCalendar }
240
     *     
241
     */
242
    public XMLGregorianCalendar getLastUpdatedBefore() {
243
        return lastUpdatedBefore;
244
    }
245
 
246
    /**
247
     * Sets the value of the lastUpdatedBefore property.
248
     * 
249
     * @param value
250
     *     allowed object is
251
     *     {@link XMLGregorianCalendar }
252
     *     
253
     */
254
    public void setLastUpdatedBefore(XMLGregorianCalendar value) {
255
        this.lastUpdatedBefore = value;
256
    }
257
 
258
    public boolean isSetLastUpdatedBefore() {
259
        return (this.lastUpdatedBefore!= null);
260
    }
261
 
262
    /**
263
     * Gets the value of the orderStatus property.
264
     * 
265
     * @return
266
     *     possible object is
267
     *     {@link OrderStatusList }
268
     *     
269
     */
270
    public OrderStatusList getOrderStatus() {
271
        return orderStatus;
272
    }
273
 
274
    /**
275
     * Sets the value of the orderStatus property.
276
     * 
277
     * @param value
278
     *     allowed object is
279
     *     {@link OrderStatusList }
280
     *     
281
     */
282
    public void setOrderStatus(OrderStatusList value) {
283
        this.orderStatus = value;
284
    }
285
 
286
    public boolean isSetOrderStatus() {
287
        return (this.orderStatus!= null);
288
    }
289
 
290
    /**
291
     * Gets the value of the marketplaceId property.
292
     * 
293
     * @return
294
     *     possible object is
295
     *     {@link MarketplaceIdList }
296
     *     
297
     */
298
    public MarketplaceIdList getMarketplaceId() {
299
        return marketplaceId;
300
    }
301
 
302
    /**
303
     * Sets the value of the marketplaceId property.
304
     * 
305
     * @param value
306
     *     allowed object is
307
     *     {@link MarketplaceIdList }
308
     *     
309
     */
310
    public void setMarketplaceId(MarketplaceIdList value) {
311
        this.marketplaceId = value;
312
    }
313
 
314
    public boolean isSetMarketplaceId() {
315
        return (this.marketplaceId!= null);
316
    }
317
 
318
    /**
319
     * Gets the value of the fulfillmentChannel property.
320
     * 
321
     * @return
322
     *     possible object is
323
     *     {@link FulfillmentChannelList }
324
     *     
325
     */
326
    public FulfillmentChannelList getFulfillmentChannel() {
327
        return fulfillmentChannel;
328
    }
329
 
330
    /**
331
     * Sets the value of the fulfillmentChannel property.
332
     * 
333
     * @param value
334
     *     allowed object is
335
     *     {@link FulfillmentChannelList }
336
     *     
337
     */
338
    public void setFulfillmentChannel(FulfillmentChannelList value) {
339
        this.fulfillmentChannel = value;
340
    }
341
 
342
    public boolean isSetFulfillmentChannel() {
343
        return (this.fulfillmentChannel!= null);
344
    }
345
 
346
    /**
347
     * Gets the value of the paymentMethod property.
348
     * 
349
     * @return
350
     *     possible object is
351
     *     {@link PaymentMethodList }
352
     *     
353
     */
354
    public PaymentMethodList getPaymentMethod() {
355
        return paymentMethod;
356
    }
357
 
358
    /**
359
     * Sets the value of the paymentMethod property.
360
     * 
361
     * @param value
362
     *     allowed object is
363
     *     {@link PaymentMethodList }
364
     *     
365
     */
366
    public void setPaymentMethod(PaymentMethodList value) {
367
        this.paymentMethod = value;
368
    }
369
 
370
    public boolean isSetPaymentMethod() {
371
        return (this.paymentMethod!= null);
372
    }
373
 
374
    /**
375
     * Gets the value of the buyerEmail property.
376
     * 
377
     * @return
378
     *     possible object is
379
     *     {@link String }
380
     *     
381
     */
382
    public String getBuyerEmail() {
383
        return buyerEmail;
384
    }
385
 
386
    /**
387
     * Sets the value of the buyerEmail property.
388
     * 
389
     * @param value
390
     *     allowed object is
391
     *     {@link String }
392
     *     
393
     */
394
    public void setBuyerEmail(String value) {
395
        this.buyerEmail = value;
396
    }
397
 
398
    public boolean isSetBuyerEmail() {
399
        return (this.buyerEmail!= null);
400
    }
401
 
402
    /**
403
     * Gets the value of the sellerOrderId property.
404
     * 
405
     * @return
406
     *     possible object is
407
     *     {@link String }
408
     *     
409
     */
410
    public String getSellerOrderId() {
411
        return sellerOrderId;
412
    }
413
 
414
    /**
415
     * Sets the value of the sellerOrderId property.
416
     * 
417
     * @param value
418
     *     allowed object is
419
     *     {@link String }
420
     *     
421
     */
422
    public void setSellerOrderId(String value) {
423
        this.sellerOrderId = value;
424
    }
425
 
426
    public boolean isSetSellerOrderId() {
427
        return (this.sellerOrderId!= null);
428
    }
429
 
430
    /**
431
     * Gets the value of the maxResultsPerPage property.
432
     * 
433
     * @return
434
     *     possible object is
435
     *     {@link Integer }
436
     *     
437
     */
438
    public Integer getMaxResultsPerPage() {
439
        return maxResultsPerPage;
440
    }
441
 
442
    /**
443
     * Sets the value of the maxResultsPerPage property.
444
     * 
445
     * @param value
446
     *     allowed object is
447
     *     {@link Integer }
448
     *     
449
     */
450
    public void setMaxResultsPerPage(Integer value) {
451
        this.maxResultsPerPage = value;
452
    }
453
 
454
    public boolean isSetMaxResultsPerPage() {
455
        return (this.maxResultsPerPage!= null);
456
    }
457
 
458
    /**
459
     * Gets the value of the tfmShipmentStatus property.
460
     * 
461
     * @return
462
     *     possible object is
463
     *     {@link TFMShipmentStatusList }
464
     *     
465
     */
466
    public TFMShipmentStatusList getTFMShipmentStatus() {
467
        return tfmShipmentStatus;
468
    }
469
 
470
    /**
471
     * Sets the value of the tfmShipmentStatus property.
472
     * 
473
     * @param value
474
     *     allowed object is
475
     *     {@link TFMShipmentStatusList }
476
     *     
477
     */
478
    public void setTFMShipmentStatus(TFMShipmentStatusList value) {
479
        this.tfmShipmentStatus = value;
480
    }
481
 
482
    public boolean isSetTFMShipmentStatus() {
483
        return (this.tfmShipmentStatus!= null);
484
    }
485
 
486
    /**
487
     * Sets the value of the SellerId property.
488
     * 
489
     * @param value
490
     * @return
491
     *     this instance
492
     */
493
    public ListOrdersRequest withSellerId(String value) {
494
        setSellerId(value);
495
        return this;
496
    }
497
 
498
    /**
499
     * Sets the value of the CreatedAfter property.
500
     * 
501
     * @param value
502
     * @return
503
     *     this instance
504
     */
505
    public ListOrdersRequest withCreatedAfter(XMLGregorianCalendar value) {
506
        setCreatedAfter(value);
507
        return this;
508
    }
509
 
510
    /**
511
     * Sets the value of the CreatedBefore property.
512
     * 
513
     * @param value
514
     * @return
515
     *     this instance
516
     */
517
    public ListOrdersRequest withCreatedBefore(XMLGregorianCalendar value) {
518
        setCreatedBefore(value);
519
        return this;
520
    }
521
 
522
    /**
523
     * Sets the value of the LastUpdatedAfter property.
524
     * 
525
     * @param value
526
     * @return
527
     *     this instance
528
     */
529
    public ListOrdersRequest withLastUpdatedAfter(XMLGregorianCalendar value) {
530
        setLastUpdatedAfter(value);
531
        return this;
532
    }
533
 
534
    /**
535
     * Sets the value of the LastUpdatedBefore property.
536
     * 
537
     * @param value
538
     * @return
539
     *     this instance
540
     */
541
    public ListOrdersRequest withLastUpdatedBefore(XMLGregorianCalendar value) {
542
        setLastUpdatedBefore(value);
543
        return this;
544
    }
545
 
546
    /**
547
     * Sets the value of the OrderStatus property.
548
     * 
549
     * @param value
550
     * @return
551
     *     this instance
552
     */
553
    public ListOrdersRequest withOrderStatus(OrderStatusList value) {
554
        setOrderStatus(value);
555
        return this;
556
    }
557
 
558
    /**
559
     * Sets the value of the MarketplaceId property.
560
     * 
561
     * @param value
562
     * @return
563
     *     this instance
564
     */
565
    public ListOrdersRequest withMarketplaceId(MarketplaceIdList value) {
566
        setMarketplaceId(value);
567
        return this;
568
    }
569
 
570
    /**
571
     * Sets the value of the FulfillmentChannel property.
572
     * 
573
     * @param value
574
     * @return
575
     *     this instance
576
     */
577
    public ListOrdersRequest withFulfillmentChannel(FulfillmentChannelList value) {
578
        setFulfillmentChannel(value);
579
        return this;
580
    }
581
 
582
    /**
583
     * Sets the value of the PaymentMethod property.
584
     * 
585
     * @param value
586
     * @return
587
     *     this instance
588
     */
589
    public ListOrdersRequest withPaymentMethod(PaymentMethodList value) {
590
        setPaymentMethod(value);
591
        return this;
592
    }
593
 
594
    /**
595
     * Sets the value of the BuyerEmail property.
596
     * 
597
     * @param value
598
     * @return
599
     *     this instance
600
     */
601
    public ListOrdersRequest withBuyerEmail(String value) {
602
        setBuyerEmail(value);
603
        return this;
604
    }
605
 
606
    /**
607
     * Sets the value of the SellerOrderId property.
608
     * 
609
     * @param value
610
     * @return
611
     *     this instance
612
     */
613
    public ListOrdersRequest withSellerOrderId(String value) {
614
        setSellerOrderId(value);
615
        return this;
616
    }
617
 
618
    /**
619
     * Sets the value of the MaxResultsPerPage property.
620
     * 
621
     * @param value
622
     * @return
623
     *     this instance
624
     */
625
    public ListOrdersRequest withMaxResultsPerPage(Integer value) {
626
        setMaxResultsPerPage(value);
627
        return this;
628
    }
629
 
630
    /**
631
     * Sets the value of the TFMShipmentStatus property.
632
     * 
633
     * @param value
634
     * @return
635
     *     this instance
636
     */
637
    public ListOrdersRequest withTFMShipmentStatus(TFMShipmentStatusList value) {
638
        setTFMShipmentStatus(value);
639
        return this;
640
    }
641
 
642
 
643
 
644
 
645
    /**
646
     *
647
     * JSON fragment representation of this object
648
     *
649
     * @return JSON fragment for this object. Name for outer
650
     * object expected to be set by calling method. This fragment
651
     * returns inner properties representation only
652
     *
653
     */
654
    protected String toJSONFragment() {
655
        StringBuffer json = new StringBuffer();
656
        boolean first = true;
657
        if (isSetSellerId()) {
658
            if (!first) json.append(", ");
659
            json.append(quoteJSON("SellerId"));
660
            json.append(" : ");
661
            json.append(quoteJSON(getSellerId()));
662
            first = false;
663
        }
664
        if (isSetCreatedAfter()) {
665
            if (!first) json.append(", ");
666
            json.append(quoteJSON("CreatedAfter"));
667
            json.append(" : ");
668
            json.append(quoteJSON(getCreatedAfter() + ""));
669
            first = false;
670
        }
671
        if (isSetCreatedBefore()) {
672
            if (!first) json.append(", ");
673
            json.append(quoteJSON("CreatedBefore"));
674
            json.append(" : ");
675
            json.append(quoteJSON(getCreatedBefore() + ""));
676
            first = false;
677
        }
678
        if (isSetLastUpdatedAfter()) {
679
            if (!first) json.append(", ");
680
            json.append(quoteJSON("LastUpdatedAfter"));
681
            json.append(" : ");
682
            json.append(quoteJSON(getLastUpdatedAfter() + ""));
683
            first = false;
684
        }
685
        if (isSetLastUpdatedBefore()) {
686
            if (!first) json.append(", ");
687
            json.append(quoteJSON("LastUpdatedBefore"));
688
            json.append(" : ");
689
            json.append(quoteJSON(getLastUpdatedBefore() + ""));
690
            first = false;
691
        }
692
        if (isSetOrderStatus()) {
693
            if (!first) json.append(", ");
694
            json.append("\"OrderStatus\" : {");
695
            OrderStatusList  orderStatus = getOrderStatus();
696
 
697
 
698
            json.append(orderStatus.toJSONFragment());
699
            json.append("}");
700
            first = false;
701
        }
702
        if (isSetMarketplaceId()) {
703
            if (!first) json.append(", ");
704
            json.append("\"MarketplaceId\" : {");
705
            MarketplaceIdList  marketplaceId = getMarketplaceId();
706
 
707
 
708
            json.append(marketplaceId.toJSONFragment());
709
            json.append("}");
710
            first = false;
711
        }
712
        if (isSetFulfillmentChannel()) {
713
            if (!first) json.append(", ");
714
            json.append("\"FulfillmentChannel\" : {");
715
            FulfillmentChannelList  fulfillmentChannel = getFulfillmentChannel();
716
 
717
 
718
            json.append(fulfillmentChannel.toJSONFragment());
719
            json.append("}");
720
            first = false;
721
        }
722
        if (isSetPaymentMethod()) {
723
            if (!first) json.append(", ");
724
            json.append("\"PaymentMethod\" : {");
725
            PaymentMethodList  paymentMethod = getPaymentMethod();
726
 
727
 
728
            json.append(paymentMethod.toJSONFragment());
729
            json.append("}");
730
            first = false;
731
        }
732
        if (isSetBuyerEmail()) {
733
            if (!first) json.append(", ");
734
            json.append(quoteJSON("BuyerEmail"));
735
            json.append(" : ");
736
            json.append(quoteJSON(getBuyerEmail()));
737
            first = false;
738
        }
739
        if (isSetSellerOrderId()) {
740
            if (!first) json.append(", ");
741
            json.append(quoteJSON("SellerOrderId"));
742
            json.append(" : ");
743
            json.append(quoteJSON(getSellerOrderId()));
744
            first = false;
745
        }
746
        if (isSetMaxResultsPerPage()) {
747
            if (!first) json.append(", ");
748
            json.append(quoteJSON("MaxResultsPerPage"));
749
            json.append(" : ");
750
            json.append(quoteJSON(getMaxResultsPerPage() + ""));
751
            first = false;
752
        }
753
        if (isSetTFMShipmentStatus()) {
754
            if (!first) json.append(", ");
755
            json.append("\"TFMShipmentStatus\" : {");
756
            TFMShipmentStatusList  TFMShipmentStatus = getTFMShipmentStatus();
757
 
758
 
759
            json.append(TFMShipmentStatus.toJSONFragment());
760
            json.append("}");
761
            first = false;
762
        }
763
        return json.toString();
764
    }
765
 
766
    /**
767
     *
768
     * Quote JSON string
769
     */
770
    private String quoteJSON(String string) {
771
        if (string == null)
772
            return "null";
773
        StringBuffer sb = new StringBuffer();
774
        sb.append("\"");
775
        int length = string.length();
776
        for (int i = 0; i < length; ++i) {
777
            char c = string.charAt(i);
778
            switch (c) {
779
            case '"':
780
                sb.append("\\\"");
781
                break;
782
            case '\\':
783
                sb.append("\\\\");
784
                break;
785
            case '/':
786
                sb.append("\\/");
787
                break;
788
            case '\b':
789
                sb.append("\\b");
790
                break;
791
            case '\f':
792
                sb.append("\\f");
793
                break;
794
            case '\n':
795
                sb.append("\\n");
796
                break;
797
            case '\r':
798
                sb.append("\\r");
799
                break;
800
            case '\t':
801
                sb.append("\\t");
802
                break;
803
            default:
804
                if (c <  ' ') {
805
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
806
                } else {
807
                sb.append(c);
808
            }
809
        }
810
        }
811
        sb.append("\"");
812
        return sb.toString();
813
    }
814
 
815
 
816
}