Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.JsonNode.asBoolean()


        {
            return jsonNode.asInt();
        }
        if( jsonNode.isBoolean() )
        {
            return jsonNode.asBoolean();
        }
        if( jsonNode.isNull() )
        {
            return null;
        }
View Full Code Here


                    child.remove();
                }
                if (value.isNull()) {
                    tree.removeProperty(name);
                } else if (value.isBoolean()) {
                    tree.setProperty(name, value.asBoolean());
                } else if (value.isLong()) {
                    tree.setProperty(name, value.asLong());
                } else if (value.isDouble()) {
                    tree.setProperty(name, value.asDouble());
                } else if (value.isBigDecimal()) {
View Full Code Here

        ScriptLanguage language = ScriptLanguage.forName(lang);
        String name = node.get(ScriptsDao.NAME).asText();
        String code = node.get(ScriptsDao.CODE).asText();
        JsonNode initialStorage = node.get(ScriptsDao.LOCAL_STORAGE);
        JsonNode library = node.get(ScriptsDao.LIB);
        boolean isLibrary =library==null?false:library.asBoolean();
        JsonNode activeNode = node.get(ScriptsDao.ACTIVE);
        boolean active = activeNode == null?false:activeNode.asBoolean();
        ODocument doc = dao.create(name, language.name, code, isLibrary, active, initialStorage);
        return doc;
    }
View Full Code Here

        String code = node.get(ScriptsDao.CODE).asText();
        JsonNode initialStorage = node.get(ScriptsDao.LOCAL_STORAGE);
        JsonNode library = node.get(ScriptsDao.LIB);
        boolean isLibrary =library==null?false:library.asBoolean();
        JsonNode activeNode = node.get(ScriptsDao.ACTIVE);
        boolean active = activeNode == null?false:activeNode.asBoolean();
        ODocument doc = dao.create(name, language.name, code, isLibrary, active, initialStorage);
        return doc;
    }

View Full Code Here

                params.put("users",users);
                ObjectNode grant = ScriptCommands.createCommand("documents","grant",params);
                JsonNode node =CommandRegistry.execute(grant, null);
                assertNotNull(node);
                assertTrue(node.isBoolean());
                assertTrue(node.asBoolean());

                DbHelper.close(DbHelper.getConnection());

                DbHelper.open("1234567890",TEST_ALT_USER,TEST_ALT_USER);
View Full Code Here

                DbHelper.open("1234567890",TEST_USER,TEST_USER);
                ObjectNode revoke = ScriptCommands.createCommand("documents", "revoke", params);
                JsonNode revoked =CommandRegistry.execute(revoke, null);
                assertNotNull(revoked);
                assertTrue(revoked.isBoolean());
                assertTrue(revoked.asBoolean());
                DbHelper.close(DbHelper.getConnection());

                DbHelper.open("1234567890",TEST_ALT_USER,TEST_ALT_USER);

                JsonNode execWithoutGrants = CommandRegistry.execute(cmd, null);
View Full Code Here

            throw new CommandParsingException(command,"missing required user");
        boolean unfollow;
        if (remove == null){
            unfollow = false;
        } else if (remove.isBoolean()){
            unfollow =remove.asBoolean();
        } else {
            throw new CommandParsingException(command,"wrong parameter remove");
        }
        if (unfollow){
            return  doUnfollow(command, from.asText(), to.asText());
View Full Code Here

                    String className = outputWriterNode.path("@class").asText();
                    OutputWriter outputWriter = (OutputWriter) Class.forName(className).newInstance();
                    JsonNode deprecatedEnabledNode = outputWriterNode.path("enabled");
                    if (!deprecatedEnabledNode.isMissingNode()) {
                        logger.warn("OutputWriter {}, deprecated usage of attribute 'enabled', settings{ \"enabled\":... } should be used instead");
                        outputWriter.setEnabled(deprecatedEnabledNode.asBoolean());
                    }
                    JsonNode settingsNode = outputWriterNode.path("settings");
                    if (settingsNode.isMissingNode()) {
                    } else if (settingsNode.isObject()) {
                        ObjectMapper mapper = new ObjectMapper();
View Full Code Here

        JsonNode processDefinitionJson = dataNode.get(i);
       
        String key = processDefinitionJson.get("key").asText();
        JsonNode graphicalNotationNode = processDefinitionJson.get("graphicalNotationDefined");
        if (key.equals("oneTaskProcessWithDi")) {
          assertTrue(graphicalNotationNode.asBoolean());
        } else {
          assertFalse(graphicalNotationNode.asBoolean());
        }
       
      }
View Full Code Here

        String key = processDefinitionJson.get("key").asText();
        JsonNode graphicalNotationNode = processDefinitionJson.get("graphicalNotationDefined");
        if (key.equals("oneTaskProcessWithDi")) {
          assertTrue(graphicalNotationNode.asBoolean());
        } else {
          assertFalse(graphicalNotationNode.asBoolean());
        }
       
      }
     
      // Verify
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.