Logo Search packages:      
Sourcecode: libjson-java version File versions

static Object net::sf::json::JSONArray::toArray ( JSONArray  jsonArray,
Class  objectClass,
Map  classMap 
) [inline, static]

Creates a java array from a JSONArray.
Any attribute is a JSONObject and matches a key in the classMap, it will be converted to that target class.
The classMap has the following conventions:

  • Every key must be an String.
  • Every value must be a Class.
  • A key may be a regular expression.

Definition at line 286 of file JSONArray.java.

References net::sf::json::JsonConfig::setClassMap(), net::sf::json::JsonConfig::setRootClass(), and toArray().

      JsonConfig jsonConfig = new JsonConfig();
      jsonConfig.setRootClass( objectClass );
      jsonConfig.setClassMap( classMap );
      return toArray( jsonArray, jsonConfig );

Generated by  Doxygen 1.6.0   Back to index