1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
---|
2 | <!--NewPage--> |
---|
3 | <HTML> |
---|
4 | <HEAD> |
---|
5 | <!-- Generated by javadoc (build 1.6.0_18) on Tue Dec 11 11:47:10 GMT 2012 --> |
---|
6 | <TITLE> |
---|
7 | JSONUtil |
---|
8 | </TITLE> |
---|
9 | |
---|
10 | <META NAME="date" CONTENT="2012-12-11"> |
---|
11 | |
---|
12 | <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> |
---|
13 | |
---|
14 | <SCRIPT type="text/javascript"> |
---|
15 | function windowTitle() |
---|
16 | { |
---|
17 | if (location.href.indexOf('is-external=true') == -1) { |
---|
18 | parent.document.title="JSONUtil"; |
---|
19 | } |
---|
20 | } |
---|
21 | </SCRIPT> |
---|
22 | <NOSCRIPT> |
---|
23 | </NOSCRIPT> |
---|
24 | |
---|
25 | </HEAD> |
---|
26 | |
---|
27 | <BODY BGCOLOR="white" onload="windowTitle();"> |
---|
28 | <HR> |
---|
29 | |
---|
30 | |
---|
31 | <!-- ========= START OF TOP NAVBAR ======= --> |
---|
32 | <A NAME="navbar_top"><!-- --></A> |
---|
33 | <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
---|
34 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
35 | <TR> |
---|
36 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
37 | <A NAME="navbar_top_firstrow"><!-- --></A> |
---|
38 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
39 | <TR ALIGN="center" VALIGN="top"> |
---|
40 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
41 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
42 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
43 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
44 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
45 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
46 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
47 | </TR> |
---|
48 | </TABLE> |
---|
49 | </TD> |
---|
50 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
51 | </EM> |
---|
52 | </TD> |
---|
53 | </TR> |
---|
54 | |
---|
55 | <TR> |
---|
56 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
57 | <A HREF="../../../../com/rabbitmq/tools/json/JSONSerializable.html" title="interface in com.rabbitmq.tools.json"><B>PREV CLASS</B></A> |
---|
58 | <A HREF="../../../../com/rabbitmq/tools/json/JSONWriter.html" title="class in com.rabbitmq.tools.json"><B>NEXT CLASS</B></A></FONT></TD> |
---|
59 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
60 | <A HREF="../../../../index.html?com/rabbitmq/tools/json/JSONUtil.html" target="_top"><B>FRAMES</B></A> |
---|
61 | <A HREF="JSONUtil.html" target="_top"><B>NO FRAMES</B></A> |
---|
62 | <SCRIPT type="text/javascript"> |
---|
63 | <!-- |
---|
64 | if(window==top) { |
---|
65 | document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
66 | } |
---|
67 | //--> |
---|
68 | </SCRIPT> |
---|
69 | <NOSCRIPT> |
---|
70 | <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
71 | </NOSCRIPT> |
---|
72 | |
---|
73 | |
---|
74 | </FONT></TD> |
---|
75 | </TR> |
---|
76 | <TR> |
---|
77 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
78 | SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
79 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
80 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
81 | </TR> |
---|
82 | </TABLE> |
---|
83 | <A NAME="skip-navbar_top"></A> |
---|
84 | <!-- ========= END OF TOP NAVBAR ========= --> |
---|
85 | |
---|
86 | <HR> |
---|
87 | <!-- ======== START OF CLASS DATA ======== --> |
---|
88 | <H2> |
---|
89 | <FONT SIZE="-1"> |
---|
90 | com.rabbitmq.tools.json</FONT> |
---|
91 | <BR> |
---|
92 | Class JSONUtil</H2> |
---|
93 | <PRE> |
---|
94 | java.lang.Object |
---|
95 | <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.rabbitmq.tools.json.JSONUtil</B> |
---|
96 | </PRE> |
---|
97 | <HR> |
---|
98 | <DL> |
---|
99 | <DT><PRE>public class <B>JSONUtil</B><DT>extends java.lang.Object</DL> |
---|
100 | </PRE> |
---|
101 | |
---|
102 | <P> |
---|
103 | Utility methods for working with JSON objects in Java. |
---|
104 | <P> |
---|
105 | |
---|
106 | <P> |
---|
107 | <HR> |
---|
108 | |
---|
109 | <P> |
---|
110 | |
---|
111 | <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
---|
112 | |
---|
113 | <A NAME="constructor_summary"><!-- --></A> |
---|
114 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
115 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
116 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
117 | <B>Constructor Summary</B></FONT></TH> |
---|
118 | </TR> |
---|
119 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
120 | <TD><CODE><B><A HREF="../../../../com/rabbitmq/tools/json/JSONUtil.html#JSONUtil()">JSONUtil</A></B>()</CODE> |
---|
121 | |
---|
122 | <BR> |
---|
123 | </TD> |
---|
124 | </TR> |
---|
125 | </TABLE> |
---|
126 | |
---|
127 | <!-- ========== METHOD SUMMARY =========== --> |
---|
128 | |
---|
129 | <A NAME="method_summary"><!-- --></A> |
---|
130 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
131 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
132 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
133 | <B>Method Summary</B></FONT></TH> |
---|
134 | </TR> |
---|
135 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
136 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
137 | <CODE>static java.lang.Object</CODE></FONT></TD> |
---|
138 | <TD><CODE><B><A HREF="../../../../com/rabbitmq/tools/json/JSONUtil.html#fill(java.lang.Object, java.util.Map)">fill</A></B>(java.lang.Object target, |
---|
139 | java.util.Map<java.lang.String,java.lang.Object> source)</CODE> |
---|
140 | |
---|
141 | <BR> |
---|
142 | Uses reflection to fill public fields and Bean properties of |
---|
143 | the target object from the source Map.</TD> |
---|
144 | </TR> |
---|
145 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
146 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
147 | <CODE>static java.lang.Object</CODE></FONT></TD> |
---|
148 | <TD><CODE><B><A HREF="../../../../com/rabbitmq/tools/json/JSONUtil.html#fill(java.lang.Object, java.util.Map, boolean)">fill</A></B>(java.lang.Object target, |
---|
149 | java.util.Map<java.lang.String,java.lang.Object> source, |
---|
150 | boolean useProperties)</CODE> |
---|
151 | |
---|
152 | <BR> |
---|
153 | Uses reflection to fill public fields and optionally Bean |
---|
154 | properties of the target object from the source Map.</TD> |
---|
155 | </TR> |
---|
156 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
157 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
158 | <CODE>static void</CODE></FONT></TD> |
---|
159 | <TD><CODE><B><A HREF="../../../../com/rabbitmq/tools/json/JSONUtil.html#tryFill(java.lang.Object, java.util.Map)">tryFill</A></B>(java.lang.Object target, |
---|
160 | java.util.Map<java.lang.String,java.lang.Object> source)</CODE> |
---|
161 | |
---|
162 | <BR> |
---|
163 | Ignores reflection exceptions while using reflection to fill |
---|
164 | public fields and Bean properties of the target object from the |
---|
165 | source Map.</TD> |
---|
166 | </TR> |
---|
167 | </TABLE> |
---|
168 | <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
---|
169 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
170 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
171 | <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> |
---|
172 | </TR> |
---|
173 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
174 | <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> |
---|
175 | </TR> |
---|
176 | </TABLE> |
---|
177 | |
---|
178 | <P> |
---|
179 | |
---|
180 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
---|
181 | |
---|
182 | <A NAME="constructor_detail"><!-- --></A> |
---|
183 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
184 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
185 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
186 | <B>Constructor Detail</B></FONT></TH> |
---|
187 | </TR> |
---|
188 | </TABLE> |
---|
189 | |
---|
190 | <A NAME="JSONUtil()"><!-- --></A><H3> |
---|
191 | JSONUtil</H3> |
---|
192 | <PRE> |
---|
193 | public <B>JSONUtil</B>()</PRE> |
---|
194 | <DL> |
---|
195 | </DL> |
---|
196 | |
---|
197 | <!-- ============ METHOD DETAIL ========== --> |
---|
198 | |
---|
199 | <A NAME="method_detail"><!-- --></A> |
---|
200 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
201 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
202 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
203 | <B>Method Detail</B></FONT></TH> |
---|
204 | </TR> |
---|
205 | </TABLE> |
---|
206 | |
---|
207 | <A NAME="fill(java.lang.Object, java.util.Map)"><!-- --></A><H3> |
---|
208 | fill</H3> |
---|
209 | <PRE> |
---|
210 | public static java.lang.Object <B>fill</B>(java.lang.Object target, |
---|
211 | java.util.Map<java.lang.String,java.lang.Object> source) |
---|
212 | throws java.beans.IntrospectionException, |
---|
213 | java.lang.IllegalAccessException, |
---|
214 | java.lang.reflect.InvocationTargetException</PRE> |
---|
215 | <DL> |
---|
216 | <DD>Uses reflection to fill public fields and Bean properties of |
---|
217 | the target object from the source Map. |
---|
218 | <P> |
---|
219 | <DD><DL> |
---|
220 | |
---|
221 | <DT><B>Throws:</B> |
---|
222 | <DD><CODE>java.beans.IntrospectionException</CODE> |
---|
223 | <DD><CODE>java.lang.IllegalAccessException</CODE> |
---|
224 | <DD><CODE>java.lang.reflect.InvocationTargetException</CODE></DL> |
---|
225 | </DD> |
---|
226 | </DL> |
---|
227 | <HR> |
---|
228 | |
---|
229 | <A NAME="fill(java.lang.Object, java.util.Map, boolean)"><!-- --></A><H3> |
---|
230 | fill</H3> |
---|
231 | <PRE> |
---|
232 | public static java.lang.Object <B>fill</B>(java.lang.Object target, |
---|
233 | java.util.Map<java.lang.String,java.lang.Object> source, |
---|
234 | boolean useProperties) |
---|
235 | throws java.beans.IntrospectionException, |
---|
236 | java.lang.IllegalAccessException, |
---|
237 | java.lang.reflect.InvocationTargetException</PRE> |
---|
238 | <DL> |
---|
239 | <DD>Uses reflection to fill public fields and optionally Bean |
---|
240 | properties of the target object from the source Map. |
---|
241 | <P> |
---|
242 | <DD><DL> |
---|
243 | |
---|
244 | <DT><B>Throws:</B> |
---|
245 | <DD><CODE>java.beans.IntrospectionException</CODE> |
---|
246 | <DD><CODE>java.lang.IllegalAccessException</CODE> |
---|
247 | <DD><CODE>java.lang.reflect.InvocationTargetException</CODE></DL> |
---|
248 | </DD> |
---|
249 | </DL> |
---|
250 | <HR> |
---|
251 | |
---|
252 | <A NAME="tryFill(java.lang.Object, java.util.Map)"><!-- --></A><H3> |
---|
253 | tryFill</H3> |
---|
254 | <PRE> |
---|
255 | public static void <B>tryFill</B>(java.lang.Object target, |
---|
256 | java.util.Map<java.lang.String,java.lang.Object> source)</PRE> |
---|
257 | <DL> |
---|
258 | <DD>Ignores reflection exceptions while using reflection to fill |
---|
259 | public fields and Bean properties of the target object from the |
---|
260 | source Map. |
---|
261 | <P> |
---|
262 | <DD><DL> |
---|
263 | </DL> |
---|
264 | </DD> |
---|
265 | </DL> |
---|
266 | <!-- ========= END OF CLASS DATA ========= --> |
---|
267 | <HR> |
---|
268 | |
---|
269 | |
---|
270 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
---|
271 | <A NAME="navbar_bottom"><!-- --></A> |
---|
272 | <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
---|
273 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
274 | <TR> |
---|
275 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
276 | <A NAME="navbar_bottom_firstrow"><!-- --></A> |
---|
277 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
278 | <TR ALIGN="center" VALIGN="top"> |
---|
279 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
280 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
281 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
282 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
283 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
284 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
285 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
286 | </TR> |
---|
287 | </TABLE> |
---|
288 | </TD> |
---|
289 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
290 | </EM> |
---|
291 | </TD> |
---|
292 | </TR> |
---|
293 | |
---|
294 | <TR> |
---|
295 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
296 | <A HREF="../../../../com/rabbitmq/tools/json/JSONSerializable.html" title="interface in com.rabbitmq.tools.json"><B>PREV CLASS</B></A> |
---|
297 | <A HREF="../../../../com/rabbitmq/tools/json/JSONWriter.html" title="class in com.rabbitmq.tools.json"><B>NEXT CLASS</B></A></FONT></TD> |
---|
298 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
299 | <A HREF="../../../../index.html?com/rabbitmq/tools/json/JSONUtil.html" target="_top"><B>FRAMES</B></A> |
---|
300 | <A HREF="JSONUtil.html" target="_top"><B>NO FRAMES</B></A> |
---|
301 | <SCRIPT type="text/javascript"> |
---|
302 | <!-- |
---|
303 | if(window==top) { |
---|
304 | document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
305 | } |
---|
306 | //--> |
---|
307 | </SCRIPT> |
---|
308 | <NOSCRIPT> |
---|
309 | <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
310 | </NOSCRIPT> |
---|
311 | |
---|
312 | |
---|
313 | </FONT></TD> |
---|
314 | </TR> |
---|
315 | <TR> |
---|
316 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
317 | SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
318 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
319 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
320 | </TR> |
---|
321 | </TABLE> |
---|
322 | <A NAME="skip-navbar_bottom"></A> |
---|
323 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
---|
324 | |
---|
325 | <HR> |
---|
326 | |
---|
327 | </BODY> |
---|
328 | </HTML> |
---|