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

How to use
isObject
method
in
org.hjson.JsonValue

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

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

    throw new PersistentStoreException("Cannot convert JSON Array to List.", null);
} else if (value.isObject()) {
  if (Map.class.isAssignableFrom(itemType)) {
    final Map<String, Object> map = new HashMap<>();
origin: TridentSDK/TridentSDK

if (el.isString() || el.isNumber() || el.isBoolean())
  cc.addWith(el.asString());
else if (el.isObject())
  cc.addWith(fromJson(el.asObject()));
if (el.isString() || el.isNumber() || el.isBoolean())
  cc.addExtra(el.asString());
else if (el.isObject())
  cc.addExtra(fromJson(el.asObject()));
org.hjsonJsonValueisObject

Javadoc

Detects whether this value represents a JSON object. If this is the case, this value is an instance of JsonObject.

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
  • asArray
    Returns this JSON value as JsonArray, assuming that this value represents a JSON array. If this is n
  • 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.
  • hashCode,
  • readJSON,
  • asFloat,
  • asInt,
  • asLong,
  • getType,
  • isBoolean,
  • isPunctuatorChar,
  • isString

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • compareTo (BigDecimal)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • 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
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • JList (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top plugins for Android Studio
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