<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0052)http://www.json.org/javadoc/org/json/JSONObject.html -->
<!--NewPage--><HTML><HEAD><TITLE>JSONObject</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><!-- Generated by javadoc (build 1.5.0_06) on Tue Jul 01 13:39:55 PDT 2008 -->
<META content="org.json.JSONObject class" name=keywords><LINK title=Style
href="JSONObject.files/stylesheet.css" type=text/css rel=stylesheet>
<SCRIPT type=text/javascript>
function windowTitle()
{
parent.document.title="JSONObject";
}
</SCRIPT>
<NOSCRIPT></NOSCRIPT>
<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY bgColor=white onload=windowTitle();><!-- ========= START OF TOP NAVBAR ======= --><A
name=navbar_top><!-- --></A><A title="Skip navigation links"
href="http://www.json.org/javadoc/org/json/JSONObject.html#skip-navbar_top"></A>
<TABLE cellSpacing=0 cellPadding=1 width="100%" summary="" border=0>
<TBODY>
<TR>
<TD class=NavBarCell1 bgColor=#eeeeff colSpan=2><A
name=navbar_top_firstrow><!-- --></A>
<TABLE cellSpacing=3 cellPadding=0 summary="" border=0>
<TBODY>
<TR vAlign=top align=middle>
<TD class=NavBarCell1 bgColor=#eeeeff><A
href="http://www.json.org/javadoc/org/json/package-summary.html"><FONT
class=NavBarFont1><B>Package</B></FONT></A> </TD>
<TD class=NavBarCell1Rev bgColor=#ffffff> <FONT
class=NavBarFont1Rev><B>Class</B></FONT> </TD>
<TD class=NavBarCell1 bgColor=#eeeeff><A
href="http://www.json.org/javadoc/org/json/class-use/JSONObject.html"><FONT
class=NavBarFont1><B>Use</B></FONT></A> </TD>
<TD class=NavBarCell1 bgColor=#eeeeff><A
href="http://www.json.org/javadoc/org/json/package-tree.html"><FONT
class=NavBarFont1><B>Tree</B></FONT></A> </TD>
<TD class=NavBarCell1 bgColor=#eeeeff><A
href="http://www.json.org/javadoc/deprecated-list.html"><FONT
class=NavBarFont1><B>Deprecated</B></FONT></A> </TD>
<TD class=NavBarCell1 bgColor=#eeeeff><A
href="http://www.json.org/javadoc/index-all.html"><FONT
class=NavBarFont1><B>Index</B></FONT></A> </TD>
<TD class=NavBarCell1 bgColor=#eeeeff><A
href="http://www.json.org/javadoc/help-doc.html"><FONT
class=NavBarFont1><B>Help</B></FONT></A> </TD></TR></TBODY></TABLE></TD>
<TD vAlign=top align=right rowSpan=3><EM></EM></TD></TR>
<TR>
<TD class=NavBarCell2 bgColor=white><FONT size=-2> <A
title="class in org.json"
href="http://www.json.org/javadoc/org/json/JSONML.html"><B>PREV
CLASS</B></A> <A title="interface in org.json"
href="http://www.json.org/javadoc/org/json/JSONString.html"><B>NEXT
CLASS</B></A></FONT></TD>
<TD class=NavBarCell2 bgColor=white><FONT size=-2><A
href="http://www.json.org/javadoc/index.html?org/json/JSONObject.html"
target=_top><B>FRAMES</B></A> <A
href="http://www.json.org/javadoc/org/json/JSONObject.html"
target=_top><B>NO FRAMES</B></A>
<SCRIPT type=text/javascript>
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT><A
href="http://www.json.org/javadoc/allclasses-noframe.html"><B>All
Classes</B></A> </NOSCRIPT></FONT></TD></TR>
<TR>
<TD class=NavBarCell3 vAlign=top><FONT
size=-2>SUMMARY: NESTED | <A
href="http://www.json.org/javadoc/org/json/JSONObject.html#field_summary">FIELD</A> | <A
href="http://www.json.org/javadoc/org/json/JSONObject.html#constructor_summary">CONSTR</A> | <A
href="http://www.json.org/javadoc/org/json/JSONObject.html#method_summary">METHOD</A></FONT></TD>
<TD class=NavBarCell3 vAlign=top><FONT size=-2>DETAIL: <A
href="http://www.json.org/javadoc/org/json/JSONObject.html#field_detail">FIELD</A> | <A
href="http://www.json.org/javadoc/org/json/JSONObject.html#constructor_detail">CONSTR</A> | <A
href="http://www.json.org/javadoc/org/json/JSONObject.html#method_detail">METHOD</A></FONT></TD></TR></TBODY></TABLE><A
name=skip-navbar_top></A><!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2><FONT size=-1>org.json</FONT> <BR>Class JSONObject</H2><PRE>java.lang.Object
<IMG alt="extended by " src="JSONObject.files/inherit.gif"><B>org.json.JSONObject</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>JSONObject</B><DT>extends java.lang.Object</DT></PRE></DT></DL><PRE></PRE>
<P>A JSONObject is an unordered collection of name/value pairs. Its external
form is a string wrapped in curly braces with colons between the names and
values, and commas between the values and names. The internal form is an object
having <CODE>get</CODE> and <CODE>opt</CODE> methods for accessing the values by
name, and <CODE>put</CODE> methods for adding or replacing values by name. The
values can be any of these types: <CODE>Boolean</CODE>, <CODE>JSONArray</CODE>,
<CODE>JSONObject</CODE>, <CODE>Number</CODE>, <CODE>String</CODE>, or the
<CODE>JSONObject.NULL</CODE> object. A JSONObject constructor can be used to
convert an external form JSON text into an internal form whose values can be
retrieved with the <CODE>get</CODE> and <CODE>opt</CODE> methods, or to convert
values into a JSON text using the <CODE>put</CODE> and <CODE>toString</CODE>
methods. A <CODE>get</CODE> method returns a value if one can be found, and
throws an exception if one cannot be found. An <CODE>opt</CODE> method returns a
default value instead of throwing an exception, and so is useful for obtaining
optional values.
<P>The generic <CODE>get()</CODE> and <CODE>opt()</CODE> methods return an
object, which you can cast or query for type. There are also typed
<CODE>get</CODE> and <CODE>opt</CODE> methods that do type checking and type
coersion for you.
<P>The <CODE>put</CODE> methods adds values to an object. For example, <PRE> myString = new JSONObject().put("JSON", "Hello, World!").toString();</PRE>produces
the string <CODE>{"JSON": "Hello, World"}</CODE>.
<P>The texts produced by the <CODE>toString</CODE> methods strictly conform to
the JSON sysntax rules. The constructors are more forgiving in the texts they
will accept:
<UL>
<LI>An extra <CODE>,</CODE> <SMALL>(comma)</SMALL> may appear just before
the closing brace.
<LI>Strings may be quoted with <CODE>'</CODE> <SMALL>(single
quote)</SMALL>.
<LI>Strings do not need to be quoted at all if they do not begin with a quote
or single quote, and if they do not contain leading or trailing spaces, and if
they do not contain any of these characters: <CODE>{ } [ ] / \ : , = ;
#</CODE> and if they do not look like numbers and if they are not the reserved
words <CODE>true</CODE>, <CODE>false</CODE>, or <CODE>null</CODE>.
<LI>Keys can be followed by <CODE>=</CODE> or <CODE>=></CODE> as well as by
<CODE>:</CODE>.
<LI>Values can be followed by <CODE>;</CODE> <SMALL>(semicolon)</SMALL> as
well as by <CODE>,</CODE> <SMALL>(comma)</SMALL>.
<LI>Numbers may have the <CODE>0-</CODE> <SMALL>(octal)</SMALL> or
<CODE>0x-</CODE> <SMALL>(hex)</SMALL> prefix.
<LI>Comments written in the slashshlash, slashstar, and hash conventions will
be ignored. </LI></UL>
<P>
<P>
<DL>
<DT><B>Version:</B>
<DD>3 </DD></DL>
<HR>
<P><!-- =========== FIELD SUMMARY =========== --><A
name=field_summary><!-- --></A>
<TABLE cellSpacing=0 cellPadding=
没有合适的资源?快使用搜索试试~ 我知道了~
jsonmeapi_ajax应用
共19个文件
htm:7个
css:6个
gif:6个
需积分: 0 5 下载量 184 浏览量
2008-08-24
10:49:41
上传
评论
收藏 44KB RAR 举报
温馨提示
json的api函数下载, DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
资源详情
资源评论
资源推荐
收起资源包目录
jsonmeapi.rar (19个子文件)
jsonmeapi
JSONStringer.files
stylesheet.css 892B
inherit.gif 57B
JSONObject.files
stylesheet.css 892B
inherit.gif 57B
JSONWriter.htm 24KB
JSON in Java.files
json160.gif 12KB
JSONString.files
stylesheet.css 892B
JSONTokener.files
stylesheet.css 892B
inherit.gif 57B
JSONArray.htm 68KB
JSONWriter.files
stylesheet.css 892B
inherit.gif 57B
JSONObject.htm 80KB
JSONTokener.htm 27KB
JSONString.htm 10KB
JSONArray.files
stylesheet.css 892B
inherit.gif 57B
JSONStringer.htm 15KB
JSON in Java.htm 10KB
共 19 条
- 1
yy0181130
- 粉丝: 16
- 资源: 22
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0