Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7468 vikram.rag 1
 
2
package com.amazonaws.mws.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.XmlType;
9
 
10
 
11
/**
12
 * <p>Java class for anonymous complex type.
13
 * 
14
 * <p>The following schema fragment specifies the expected content contained within this class.
15
 * 
16
 * <pre>
17
 * &lt;complexType>
18
 *   &lt;complexContent>
19
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
20
 *       &lt;sequence>
21
 *         &lt;element name="FeedSubmissionInfo" type="{http://mws.amazonaws.com/doc/2009-01-01/}FeedSubmissionInfo"/>
22
 *       &lt;/sequence>
23
 *     &lt;/restriction>
24
 *   &lt;/complexContent>
25
 * &lt;/complexType>
26
 * </pre>
27
 * Generated by AWS Code Generator
28
 * <p/>
29
 * Tue Feb 03 16:00:09 PST 2009
30
 * 
31
 */
32
@XmlAccessorType(XmlAccessType.FIELD)
33
@XmlType(name = "", propOrder = {
34
    "feedSubmissionInfo"
35
})
36
@XmlRootElement(name = "SubmitFeedResult")
37
public class SubmitFeedResult {
38
 
39
    @XmlElement(name = "FeedSubmissionInfo", required = true)
40
    protected FeedSubmissionInfo feedSubmissionInfo;
41
 
42
    /**
43
     * Default constructor
44
     * 
45
     */
46
    public SubmitFeedResult() {
47
        super();
48
    }
49
 
50
    /**
51
     * Value constructor
52
     * 
53
     */
54
    public SubmitFeedResult(final FeedSubmissionInfo feedSubmissionInfo) {
55
        this.feedSubmissionInfo = feedSubmissionInfo;
56
    }
57
 
58
    /**
59
     * Gets the value of the feedSubmissionInfo property.
60
     * 
61
     * @return
62
     *     possible object is
63
     *     {@link FeedSubmissionInfo }
64
     *     
65
     */
66
    public FeedSubmissionInfo getFeedSubmissionInfo() {
67
        return feedSubmissionInfo;
68
    }
69
 
70
    /**
71
     * Sets the value of the feedSubmissionInfo property.
72
     * 
73
     * @param value
74
     *     allowed object is
75
     *     {@link FeedSubmissionInfo }
76
     *     
77
     */
78
    public void setFeedSubmissionInfo(FeedSubmissionInfo value) {
79
        this.feedSubmissionInfo = value;
80
    }
81
 
82
    public boolean isSetFeedSubmissionInfo() {
83
        return (this.feedSubmissionInfo!= null);
84
    }
85
 
86
    /**
87
     * Sets the value of the FeedSubmissionInfo property.
88
     * 
89
     * @param value
90
     * @return
91
     *     this instance
92
     */
93
    public SubmitFeedResult withFeedSubmissionInfo(FeedSubmissionInfo value) {
94
        setFeedSubmissionInfo(value);
95
        return this;
96
    }
97
 
98
 
99
    /**
100
     * 
101
     * XML fragment representation of this object
102
     * 
103
     * @return XML fragment for this object. Name for outer
104
     * tag expected to be set by calling method. This fragment
105
     * returns inner properties representation only
106
     */
107
    protected String toXMLFragment() {
108
        StringBuffer xml = new StringBuffer();
109
        if (isSetFeedSubmissionInfo()) {
110
            FeedSubmissionInfo  feedSubmissionInfo = getFeedSubmissionInfo();
111
            xml.append("<FeedSubmissionInfo>");
112
            xml.append(feedSubmissionInfo.toXMLFragment());
113
            xml.append("</FeedSubmissionInfo>");
114
        } 
115
        return xml.toString();
116
    }
117
 
118
    /**
119
     * 
120
     * Escape XML special characters
121
     */
122
    private String escapeXML(String string) {
123
        StringBuffer sb = new StringBuffer();
124
        int length = string.length();
125
        for (int i = 0; i < length; ++i) {
126
            char c = string.charAt(i);
127
            switch (c) {
128
            case '&':
129
                sb.append("&amp;");
130
                break;
131
            case '<':
132
                sb.append("&lt;");
133
                break;
134
            case '>':
135
                sb.append("&gt;");
136
                break;
137
            case '\'':
138
                sb.append("&#039;");
139
                break;
140
            case '"':
141
                sb.append("&quot;");
142
                break;
143
            default:
144
                sb.append(c);
145
            }
146
        }
147
        return sb.toString();
148
    }
149
 
150
 
151
 
152
    /**
153
     *
154
     * JSON fragment representation of this object
155
     *
156
     * @return JSON fragment for this object. Name for outer
157
     * object expected to be set by calling method. This fragment
158
     * returns inner properties representation only
159
     *
160
     */
161
    protected String toJSONFragment() {
162
        StringBuffer json = new StringBuffer();
163
        boolean first = true;
164
        if (isSetFeedSubmissionInfo()) {
165
            if (!first) json.append(", ");
166
            json.append("\"FeedSubmissionInfo\" : {");
167
            FeedSubmissionInfo  feedSubmissionInfo = getFeedSubmissionInfo();
168
 
169
 
170
            json.append(feedSubmissionInfo.toJSONFragment());
171
            json.append("}");
172
            first = false;
173
        }
174
        return json.toString();
175
    }
176
 
177
    /**
178
     *
179
     * Quote JSON string
180
     */
181
    private String quoteJSON(String string) {
182
        StringBuffer sb = new StringBuffer();
183
        sb.append("\"");
184
        int length = string.length();
185
        for (int i = 0; i < length; ++i) {
186
            char c = string.charAt(i);
187
            switch (c) {
188
            case '"':
189
                sb.append("\\\"");
190
                break;
191
            case '\\':
192
                sb.append("\\\\");
193
                break;
194
            case '/':
195
                sb.append("\\/");
196
                break;
197
            case '\b':
198
                sb.append("\\b");
199
                break;
200
            case '\f':
201
                sb.append("\\f");
202
                break;
203
            case '\n':
204
                sb.append("\\n");
205
                break;
206
            case '\r':
207
                sb.append("\\r");
208
                break;
209
            case '\t':
210
                sb.append("\\t");
211
                break;
212
            default:
213
                if (c <  ' ') {
214
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
215
                } else {
216
                sb.append(c);
217
            }
218
        }
219
        }
220
        sb.append("\"");
221
        return sb.toString();
222
    }
223
 
224
 
225
}