本文整理了Java中org.json.JSONObject.isStandardProperty()
方法的一些代码示例,展示了JSONObject.isStandardProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.isStandardProperty()
方法的具体详情如下:
包路径:org.json.JSONObject
类名称:JSONObject
方法名:isStandardProperty
暂无
代码示例来源:origin: fernandospr/javapns-jdk16
/**
* Construct a JSONArray from a collection of beans.
* The collection should have Java Beans.
*
* @throws JSONException If not an array.
*/
public JSONArray(Collection collection, boolean includeSuperClass) {
this.myArrayList = new ArrayList();
if (collection != null) {
Iterator iter = collection.iterator();;
while (iter.hasNext()) {
Object o = iter.next();
if (o instanceof Map) {
this.myArrayList.add(new JSONObject((Map)o, includeSuperClass));
} else if (!JSONObject.isStandardProperty(o.getClass())) {
this.myArrayList.add(new JSONObject(o, includeSuperClass));
} else {
this.myArrayList.add(o);
}
}
}
}
代码示例来源:origin: uk.org.retep.tools/util
/**
* Construct a JSONArray from a collection of beans.
* The collection should have Java Beans.
*
* @throws JSONException If not an array.
*/
public JSONArray(Collection collection, boolean includeSuperClass) {
this.myArrayList = new ArrayList();
if (collection != null) {
Iterator iter = collection.iterator();;
while (iter.hasNext()) {
Object o = iter.next();
if (o instanceof Map) {
this.myArrayList.add(new JSONObject((Map)o, includeSuperClass));
} else if (!JSONObject.isStandardProperty(o.getClass())) {
this.myArrayList.add(new JSONObject(o, includeSuperClass));
} else {
this.myArrayList.add(o);
}
}
}
}
代码示例来源:origin: org.datanucleus/datanucleus-api-json
/**
* Construct a JSONArray from a collection of beans.
* The collection should have Java Beans.
*
* @throws JSONException If not an array.
*/
public JSONArray(Collection collection, boolean includeSuperClass) {
this.myArrayList = new ArrayList();
if (collection != null) {
Iterator iter = collection.iterator();;
while (iter.hasNext()) {
Object o = iter.next();
if (o instanceof Map || !JSONObject.isStandardProperty(o.getClass())) {
this.myArrayList.add(new JSONObject((Map)o, includeSuperClass));
} else {
this.myArrayList.add(o);
}
}
}
}
代码示例来源:origin: fernandospr/javapns-jdk16
/**
* Construct a JSONObject from a Map.
*
* Note: Use this constructor when the map contains <key,bean>.
*
* @param map - A map with Key-Bean data.
* @param includeSuperClass - Tell whether to include the super class properties.
*/
public JSONObject(Map map, boolean includeSuperClass) {
this.map = new HashMap();
if (map != null) {
Iterator i = map.entrySet().iterator();
while (i.hasNext()) {
Map.Entry e = (Map.Entry) i.next();
if (isStandardProperty(e.getValue().getClass())) {
this.map.put(e.getKey(), e.getValue());
} else {
this.map.put(e.getKey(), new JSONObject(e.getValue(), includeSuperClass));
}
}
}
}
代码示例来源:origin: uk.org.retep.tools/util
/**
* Construct a JSONArray from an array with a bean.
* The array should have Java Beans.
*
* @throws JSONException If not an array.
*/
public JSONArray(Object array,boolean includeSuperClass) throws JSONException {
this();
if (array.getClass().isArray()) {
int length = Array.getLength(array);
for (int i = 0; i < length; i += 1) {
Object o = Array.get(array, i);
if (JSONObject.isStandardProperty(o.getClass())) {
this.myArrayList.add(o);
} else {
this.myArrayList.add(new JSONObject(o,includeSuperClass));
}
}
} else {
throw new JSONException("JSONArray initial value should be a string or collection or array.");
}
}
代码示例来源:origin: uk.org.retep.tools/util
/**
* Construct a JSONObject from a Map.
*
* Note: Use this constructor when the map contains <key,bean>.
*
* @param map - A map with Key-Bean data.
* @param includeSuperClass - Tell whether to include the super class properties.
*/
public JSONObject(Map map, boolean includeSuperClass) {
this.map = new HashMap();
if (map != null) {
Iterator i = map.entrySet().iterator();
while (i.hasNext()) {
Map.Entry e = (Map.Entry)i.next();
if (isStandardProperty(e.getValue().getClass())) {
this.map.put(e.getKey(), e.getValue());
} else {
this.map.put(e.getKey(), new JSONObject(e.getValue(),
includeSuperClass));
}
}
}
}
代码示例来源:origin: org.datanucleus/datanucleus-api-json
/**
* Construct a JSONObject from a Map.
*
* Note: Use this constructor when the map contains <key,bean>.
*
* @param map - A map with Key-Bean data.
* @param includeSuperClass - Tell whether to include the super class properties.
*/
public JSONObject(Map map, boolean includeSuperClass) {
this.map = new HashMap();
if (map != null) {
Iterator i = map.entrySet().iterator();
while (i.hasNext()) {
Map.Entry e = (Map.Entry)i.next();
if (isStandardProperty(e.getValue().getClass())) {
this.map.put(e.getKey(), e.getValue());
} else {
this.map.put(e.getKey(), new JSONObject(e.getValue(),
includeSuperClass));
}
}
}
}
代码示例来源:origin: org.datanucleus/datanucleus-api-json
/**
* Construct a JSONArray from an array with a bean.
* The array should have Java Beans.
*
* @throws JSONException If not an array.
*/
public JSONArray(Object array,boolean includeSuperClass) throws JSONException {
this();
if (array.getClass().isArray()) {
int length = Array.getLength(array);
for (int i = 0; i < length; i += 1) {
Object o = Array.get(array, i);
if (JSONObject.isStandardProperty(o.getClass())) {
this.myArrayList.add(o);
} else {
this.myArrayList.add(new JSONObject(o,includeSuperClass));
}
}
} else {
throw new JSONException("JSONArray initial value should be a string or collection or array.");
}
}
代码示例来源:origin: fernandospr/javapns-jdk16
/**
* Construct a JSONArray from an array with a bean.
* The array should have Java Beans.
*
* @throws JSONException If not an array.
*/
public JSONArray(Object array,boolean includeSuperClass) throws JSONException {
this();
if (array.getClass().isArray()) {
int length = Array.getLength(array);
for (int i = 0; i < length; i += 1) {
Object o = Array.get(array, i);
if (JSONObject.isStandardProperty(o.getClass())) {
this.myArrayList.add(o);
} else {
this.myArrayList.add(new JSONObject(o,includeSuperClass));
}
}
} else {
throw new JSONException("JSONArray initial value should be a string or collection or array.");
}
}
代码示例来源:origin: com.vaadin.external.json/json
}else if (result instanceof Map) {
map.put(key, new JSONObject((Map)result,includeSuperClass));
}else if (isStandardProperty(result.getClass())) { //Primitives, String and Wrapper
map.put(key, result);
}else{
代码示例来源:origin: fernandospr/javapns-jdk16
} else if (result instanceof Map) {
map.put(key, new JSONObject((Map) result, includeSuperClass));
} else if (isStandardProperty(result.getClass())) { // Primitives, String and Wrapper
map.put(key, result);
} else {
代码示例来源:origin: de.twentyeleven.skysail/org.json-osgi
}else if (result instanceof Map) {
map.put(key, new JSONObject((Map)result,includeSuperClass));
}else if (isStandardProperty(result.getClass())) { //Primitives, String and Wrapper
map.put(key, result);
}else{
代码示例来源:origin: com.vaadin/vaadin-shared-deps
}else if (result instanceof Map) {
map.put(key, new JSONObject((Map)result,includeSuperClass));
}else if (isStandardProperty(result.getClass())) { //Primitives, String and Wrapper
map.put(key, result);
}else{
代码示例来源:origin: uk.org.retep.tools/util
} else if (result instanceof Map) {
map.put(key, new JSONObject((Map)result, includeSuperClass));
} else if (isStandardProperty(result.getClass())) { // Primitives, String and Wrapper
map.put(key, result);
} else {
代码示例来源:origin: org.datanucleus/datanucleus-api-json
} else if (result instanceof Map) {
map.put(key, new JSONObject((Map)result, includeSuperClass));
} else if (isStandardProperty(result.getClass())) { // Primitives, String and Wrapper
map.put(key, result);
} else {
内容来源于网络,如有侵权,请联系作者删除!