Tabnine Logo
JsonValue.asArray
Code IndexAdd Tabnine to your IDE (free)

How to use
asArray
method
in
org.hjson.JsonValue

Best Java code snippets using org.hjson.JsonValue.asArray (Showing top 7 results out of 315)

origin: org.hjson/hjson

 break;
case ARRAY:
 JsonArray arr=value.asArray();
 int n=arr.size();
 if (!noIndent) { if (n>0) nl(tw, level); else tw.write(separator); }
origin: org.hjson/hjson

 break;
case ARRAY:
 JsonArray arr=value.asArray();
 int n=arr.size();
 if (n>0) nl(tw, level);
origin: hjson/hjson-java

 break;
case ARRAY:
 JsonArray arr=value.asArray();
 int n=arr.size();
 if (n>0) nl(tw, level);
origin: hjson/hjson-java

 break;
case ARRAY:
 JsonArray arr=value.asArray();
 int n=arr.size();
 if (!noIndent) { if (n>0) nl(tw, level); else tw.write(separator); }
origin: net.akehurst.application.framework/net.akehurst.application.framework.technology.persistence.filesystem

Object convertJsonToJava(final JsonValue value) throws PersistentStoreException {
  if (null == value) {
    return null;
  } else if (value.isString()) {
    return value.asString();
  } else if (value.isNumber()) {
    return value.asDouble();
  } else if (value.isBoolean()) {
    return value.asBoolean();
  } else if (value.isArray()) {
    final List<Object> list = new ArrayList<>();
    for (final JsonValue av : value.asArray()) {
      final Object o = this.convertJsonToJava(av);
      list.add(o);
    }
    return list;
  } else if (value.isObject()) {
    final Map<String, Object> map = new HashMap<>();
    for (final String k : value.asObject().names()) {
      final JsonValue jv = value.asObject().get(k);
      final Object v = this.convertJsonToJava(jv);
      map.put(k, v);
    }
    return map;
  } else {
    throw new PersistentStoreException("Unknown JSON type.", null);
  }
}
origin: net.akehurst.application.framework/net.akehurst.application.framework.technology.persistence.filesystem

if (List.class.isAssignableFrom(itemType)) {
  final List list = new ArrayList<>();
  for (final JsonValue av : value.asArray()) {
    final Object o = this.convertJsonToJava(av);
    list.add(o);
origin: TridentSDK/TridentSDK

JsonArray array = with.asArray();
for (int i = 0, j = array.size(); i < j; i++) {
  JsonValue el = array.get(i);
JsonArray array = extra.asArray();
for (int i = 0, j = array.size(); i < j; i++) {
  JsonValue el = array.get(i);
org.hjsonJsonValueasArray

Javadoc

Returns this JSON value as JsonArray, assuming that this value represents a JSON array. If this is not the case, an exception is thrown.

Popular methods of JsonValue

  • toString
    Returns the JSON/Hjson string for this value using the given formatting.
  • readHjson
    Reads a Hjson value from the given string.
  • asObject
    Returns this JSON value as JsonObject, assuming that this value represents a JSON object. If this is
  • asString
    Returns this JSON value as String, assuming that this value represents a JSON string. If this is not
  • asBoolean
    Returns this JSON value as a boolean value, assuming that this value is either true or false. If thi
  • isNumber
    Detects whether this value represents a JSON number.
  • writeTo
    Writes the JSON/Hjson representation of this value to the given writer using the given formatting. W
  • asDouble
    Returns this JSON value as a double value, assuming that this value represents a JSON number. If thi
  • equals
    Indicates whether some other object is "equal to" this one according to the contract specified in Ob
  • hashCode
  • readJSON
    Reads a JSON value from the given string.
  • asFloat
    Returns this JSON value as a float value, assuming that this value represents a JSON number. If this
  • readJSON,
  • asFloat,
  • asInt,
  • asLong,
  • getType,
  • isBoolean,
  • isObject,
  • isPunctuatorChar,
  • isString

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now