org.json.JSONObject.populateMap()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(16.8k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中org.json.JSONObject.populateMap()方法的一些代码示例,展示了JSONObject.populateMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.populateMap()方法的具体详情如下:
包路径:org.json.JSONObject
类名称:JSONObject
方法名:populateMap

JSONObject.populateMap介绍

[英]Populates the internal map of the JSONObject with the bean properties. The bean can not be recursive.
[中]用bean属性填充JSONObject的内部映射。bean不能是递归的。

代码示例

代码示例来源:origin: zzz40500/GsonFormat

/**
 * Construct a JSONObject from an Object using bean getters. It reflects on
 * all of the public methods of the object. For each of the methods with no
 * parameters and a name starting with <code>"get"</code> or
 * <code>"is"</code> followed by an uppercase letter, the method is invoked,
 * and a key and the value returned from the getter method are put into the
 * new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code>
 * prefix. If the second remaining character is not upper case, then the
 * first character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is
 * <code>"Larry Fine"</code>, then the JSONObject will contain
 * <code>"name": "Larry Fine"</code>.
 *
 * @param bean
 *            An object that has getter methods that should be used to make
 *            a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  this.populateMap(bean);
}

代码示例来源:origin: loklak/loklak_server

/**
 * Construct a JSONObject from an Object using bean getters. It reflects on
 * all of the public methods of the object. For each of the methods with no
 * parameters and a name starting with <code>"get"</code> or
 * <code>"is"</code> followed by an uppercase letter, the method is invoked,
 * and a key and the value returned from the getter method are put into the
 * new JSONObject.
 * <p>
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code>
 * prefix. If the second remaining character is not upper case, then the
 * first character is converted to lower case.
 * <p>
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is
 * <code>"Larry Fine"</code>, then the JSONObject will contain
 * <code>"name": "Larry Fine"</code>.
 * <p>
 * Methods that return <code>void</code> as well as <code>static</code>
 * methods are ignored.
 * 
 * @param bean
 *            An object that has getter methods that should be used to make
 *            a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  this.populateMap(bean);
}

代码示例来源:origin: b3log/latke

this.populateMap(bean);

代码示例来源:origin: org.daisy.libs/com.xmlcalabash

/**
 * Construct a JSONObject from an Object using bean getters.
 * It reflects on all of the public methods of the object.
 * For each of the methods with no parameters and a name starting
 * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
 * the method is invoked, and a key and the value returned from the getter method
 * are put into the new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix.
 * If the second remaining character is not upper case, then the first
 * character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
 * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
 *
 * @param bean An object that has getter methods that should be used
 * to make a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  populateMap(bean);
}

代码示例来源:origin: com.xmlcalabash/xmlcalabash

/**
 * Construct a JSONObject from an Object using bean getters.
 * It reflects on all of the public methods of the object.
 * For each of the methods with no parameters and a name starting
 * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
 * the method is invoked, and a key and the value returned from the getter method
 * are put into the new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix.
 * If the second remaining character is not upper case, then the first
 * character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
 * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
 *
 * @param bean An object that has getter methods that should be used
 * to make a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  populateMap(bean);
}

代码示例来源:origin: org.dynamicloud.api/dynamicloud

/**
 * Construct a JSONObject from an Object using bean getters.
 * It reflects on all of the public methods of the object.
 * For each of the methods with no parameters and a name starting
 * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
 * the method is invoked, and a key and the value returned from the getter method
 * are put into the new JSONObject.
 * <p/>
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix.
 * If the second remaining character is not upper case, then the first
 * character is converted to lower case.
 * <p/>
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
 * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
 *
 * @param bean An object that has getter methods that should be used
 *             to make a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  populateMap(bean);
}

代码示例来源:origin: io.snappydata/gemfire-util

/**
 * Construct a JSONObject from an Object using bean getters.
 * It reflects on all of the public methods of the object.
 * For each of the methods with no parameters and a name starting
 * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
 * the method is invoked, and a key and the value returned from the getter method
 * are put into the new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix.
 * If the second remaining character is not upper case, then the first
 * character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
 * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
 *
 * @param bean An object that has getter methods that should be used
 * to make a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  this.populateMap(bean);
}

代码示例来源:origin: quux00/hive-json-schema

/**
 * Construct a JSONObject from an Object using bean getters.
 * It reflects on all of the public methods of the object.
 * For each of the methods with no parameters and a name starting
 * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
 * the method is invoked, and a key and the value returned from the getter method
 * are put into the new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix.
 * If the second remaining character is not upper case, then the first
 * character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
 * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
 *
 * @param bean An object that has getter methods that should be used
 * to make a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  populateMap(bean);
}

代码示例来源:origin: org.json/com.springsource.org.json

/**
 * Construct a JSONObject from an Object using bean getters.
 * It reflects on all of the public methods of the object.
 * For each of the methods with no parameters and a name starting
 * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
 * the method is invoked, and a key and the value returned from the getter method
 * are put into the new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix.
 * If the second remaining character is not upper case, then the first
 * character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
 * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
 *
 * @param bean An object that has getter methods that should be used
 * to make a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  populateMap(bean);
}

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

/**
 * Construct a JSONObject from an Object using bean getters.
 * It reflects on all of the public methods of the object.
 * For each of the methods with no parameters and a name starting
 * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
 * the method is invoked, and a key and the value returned from the getter method
 * are put into the new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix.
 * If the second remaining character is not upper case, then the first
 * character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
 * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
 *
 * @param bean An object that has getter methods that should be used
 * to make a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  populateMap(bean);
}

代码示例来源:origin: com.barchart.wrap/barchart-wrap-jackson

/**
 * Construct a JSONObject from an Object using bean getters.
 * It reflects on all of the public methods of the object.
 * For each of the methods with no parameters and a name starting
 * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
 * the method is invoked, and a key and the value returned from the getter method
 * are put into the new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix.
 * If the second remaining character is not upper case, then the first
 * character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
 * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
 *
 * @param bean An object that has getter methods that should be used
 * to make a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  this.populateMap(bean);
}

代码示例来源:origin: com.unboundid.components/json

/**
 * Construct a JSONObject from an Object using bean getters.
 * It reflects on all of the public methods of the object.
 * For each of the methods with no parameters and a name starting
 * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
 * the method is invoked, and a key and the value returned from the getter method
 * are put into the new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix.
 * If the second remaining character is not upper case, then the first
 * character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
 * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
 *
 * @param bean An object that has getter methods that should be used
 * to make a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  populateMap(bean);
}

代码示例来源:origin: io.snappydata/gemfire-json

/**
 * Construct a JSONObject from an Object using bean getters.
 * It reflects on all of the public methods of the object.
 * For each of the methods with no parameters and a name starting
 * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
 * the method is invoked, and a key and the value returned from the getter method
 * are put into the new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix.
 * If the second remaining character is not upper case, then the first
 * character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
 * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
 *
 * @param bean An object that has getter methods that should be used
 * to make a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  this.populateMap(bean);
}

代码示例来源:origin: org.everit.osgi.bundles/org.everit.osgi.bundles.org.json

/**
 * Construct a JSONObject from an Object using bean getters. It reflects on
 * all of the public methods of the object. For each of the methods with no
 * parameters and a name starting with <code>"get"</code> or
 * <code>"is"</code> followed by an uppercase letter, the method is invoked,
 * and a key and the value returned from the getter method are put into the
 * new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code>
 * prefix. If the second remaining character is not upper case, then the
 * first character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is
 * <code>"Larry Fine"</code>, then the JSONObject will contain
 * <code>"name": "Larry Fine"</code>.
 *
 * @param bean
 *            An object that has getter methods that should be used to make
 *            a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  this.populateMap(bean);
}

代码示例来源:origin: aruld/java-oneliners

/**
 * Construct a JSONObject from an Object using bean getters.
 * It reflects on all of the public methods of the object.
 * For each of the methods with no parameters and a name starting
 * with <code>"get"</code> or <code>"is"</code> followed by an uppercase letter,
 * the method is invoked, and a key and the value returned from the getter method
 * are put into the new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix.
 * If the second remaining character is not upper case, then the first
 * character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is <code>"Larry Fine"</code>,
 * then the JSONObject will contain <code>"name": "Larry Fine"</code>.
 *
 * @param bean An object that has getter methods that should be used
 * to make a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  this.populateMap(bean);
}

代码示例来源:origin: org.codeartisans/org.json

/**
 * Construct a JSONObject from an Object using bean getters. It reflects on
 * all of the public methods of the object. For each of the methods with no
 * parameters and a name starting with <code>"get"</code> or
 * <code>"is"</code> followed by an uppercase letter, the method is invoked,
 * and a key and the value returned from the getter method are put into the
 * new JSONObject.
 *
 * The key is formed by removing the <code>"get"</code> or <code>"is"</code>
 * prefix. If the second remaining character is not upper case, then the
 * first character is converted to lower case.
 *
 * For example, if an object has a method named <code>"getName"</code>, and
 * if the result of calling <code>object.getName()</code> is
 * <code>"Larry Fine"</code>, then the JSONObject will contain
 * <code>"name": "Larry Fine"</code>.
 *
 * @param bean
 *            An object that has getter methods that should be used to make
 *            a JSONObject.
 */
public JSONObject(Object bean) {
  this();
  this.populateMap(bean);
}

代码示例来源:origin: org.b3log/latke

this.populateMap(bean);

代码示例来源:origin: ndw/xmlcalabash1

/**
 * JSONObject.NULL is equivalent to the value that JavaScript calls null,
 * whilst Java's null is equivalent to the value that JavaScript calls
 * undefined.
 */
 private static final class Null {
  /**
   * There is only intended to be a single instance of the NULL object,
   * so the clone method returns itself.
   * @return     NULL.
   */
  protected final Object clone() {
    return this;
  }
  /**
   * A Null object is equal to the null value and to itself.
   * @param object    An object to test for nullness.
   * @return true if the object parameter is the JSONObject.NULL object
   *  or null.
   */
  public boolean equals(Object object) {
    return object == null || object == this;
  }
  /**
   * Get the "null" string value.

相关文章

JSONObject类方法