Examples of ObjectNode


Examples of com.facebook.presto.hive.shaded.org.codehaus.jackson.node.ObjectNode

   
    @Override
    public JsonNode getSchema(SerializerProvider provider, Type typeHint)
        throws JsonMappingException
    {
        ObjectNode objectNode = createObjectNode();
        String schemaType = "any";
        String objectProperties = null;
        String itemDefinition = null;
        if (typeHint != null) {
            Class<?> rawClass = TypeFactory.type(typeHint).getRawClass();
            if (rawClass.isAnnotationPresent(JsonSerializableSchema.class)) {
                JsonSerializableSchema schemaInfo = rawClass.getAnnotation(JsonSerializableSchema.class);
                schemaType = schemaInfo.schemaType();
                if (!"##irrelevant".equals(schemaInfo.schemaObjectPropertiesDefinition())) {
                    objectProperties = schemaInfo.schemaObjectPropertiesDefinition();
                }
                if (!"##irrelevant".equals(schemaInfo.schemaItemDefinition())) {
                    itemDefinition = schemaInfo.schemaItemDefinition();
                }
            }
        }
        objectNode.put("type", schemaType);
        if (objectProperties != null) {
            try {
                objectNode.put("properties", new ObjectMapper().readValue(objectProperties, JsonNode.class));
            } catch (IOException e) {
                throw new IllegalStateException(e);
            }
        }
        if (itemDefinition != null) {
            try {
                objectNode.put("items", new ObjectMapper().readValue(itemDefinition, JsonNode.class));
            } catch (IOException e) {
                throw new IllegalStateException(e);
            }
        }
        // always optional, no need to specify:
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jackson.databind.node.ObjectNode

     *
     * @return The default schema node.
     */
    public static JsonNode getDefaultSchemaNode()
    {
        ObjectNode objectNode = JsonNodeFactory.instance.objectNode();
        objectNode.put("type", "any");
        // "required" is false by default, no need to include
        //objectNode.put("required", false);
        return objectNode;
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.ObjectNode

            new LinkedBlockingQueue<Runnable>(),
            new NamedThreadFactory("dbEc"));
    private static final ExecutionContext dbEc = ExecutionContexts.fromExecutorService(tpe);

    public static Result json() {
        final ObjectNode result = OBJECT_MAPPER.createObjectNode();
        result.put("message", "Hello World!");
        return ok(result);
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.ObjectNode

            new LinkedBlockingQueue<Runnable>(),
            new NamedThreadFactory("dbEc"));
    private static final ExecutionContext dbEc = ExecutionContexts.fromExecutorService(tpe);

    public static Result json() {
        final ObjectNode result = OBJECT_MAPPER.createObjectNode();
        result.put("message", "Hello World!");
        return ok(result);
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.ObjectNode

    //http://stackoverflow.com/questions/3907929/should-i-make-jacksons-objectmapper-as-static-final
    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();

    public static Result json() {
        final ObjectNode result = OBJECT_MAPPER.createObjectNode();
        result.put("message", "Hello, World!");
        return ok(result);
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.ObjectNode

    private static final Logger LOG = LoggerFactory.getLogger(Ping.class);

    public static void ping(AsyncHttpClient client, URI server, URI ourUri, String radioId) throws IOException, ExecutionException, InterruptedException {
        ObjectMapper mapper = new ObjectMapper();

        ObjectNode rootNode = mapper.createObjectNode();
        rootNode.put("rest_transport_address", ourUri.toString());

        final UriBuilder uriBuilder = UriBuilder.fromUri(server);
        uriBuilder.path("/system/radios/" + radioId + "/ping");

        Future<Response> f = client.preparePut(uriBuilder.build().toString())
                .setBody(rootNode.toString())
                .execute();

        Response r = f.get();

        if (r.getStatusCode() != 200) {
View Full Code Here

Examples of com.intellij.openapi.util.objectTree.ObjectNode

    boolean firstObject = true;

    final Set<Object> objects = ourTree.getRootObjects();
    for (Object object : objects) {
      if (object == null) continue;
      final ObjectNode objectNode = ourTree.getObject2NodeMap().get(object);
      if (objectNode == null) continue;

      if (firstObject) {
        firstObject = false;
        System.err.println("***********************************************************************************************");
        System.err.println("***                        M E M O R Y    L E A K S   D E T E C T E D                       ***");
        System.err.println("***********************************************************************************************");
        System.err.println("***                                                                                         ***");
        System.err.println("***   The following objects were not disposed: ");
      }

      System.err.println("***   " + object + " of class " + object.getClass());
      final Throwable trace = objectNode.getTrace();
      if (trace != null) {
        System.err.println("***         First seen at: ");
        trace.printStackTrace();
      }
    }
View Full Code Here

Examples of nz.govt.natlib.adapter.pdf.dom.ObjectNode

  private boolean hasUserKey() {
    return false;
  }

  public void decrypt(PDFNode value) {
    ObjectNode obj = value.getContainingObject();
    if (obj == null)
      return; // time to go back!
    int objId = obj.getId();
    int objVer = obj.getVersion();

    // take all the strings and decrypt them...
    if (value instanceof StringNode) {
      StringNode strNode = (StringNode) value;
      strNode.setValue(decryptString(strNode.getStringValue(), objId,
          objVer));
    }

    if (value instanceof ObjectNode) {
      ObjectNode o = (ObjectNode) value;
      decrypt(o.getValue());
    }

    if (value instanceof DictionaryNode) {
      DictionaryNode dict = (DictionaryNode) value;
      for (int i = 0; i < dict.size(); i++) {
View Full Code Here

Examples of org.apache.harmony.beans.ObjectNode

        e = roots.elements();
        while (e.hasMoreElements()) {
            Object object = e.nextElement();

            if (object != null) {
                ObjectNode node = nodes.get(object);

                printObjectTag(0, object, node);
            } else {
                printNullTag(0);
            }
View Full Code Here

Examples of org.apache.slide.structure.ObjectNode

            subject = config.getUsersPath()+"/"+
                      ((PrincipalSourcePermission) sourcepermission).getPrincipal();

            // Test if principal exists
            try {
                ObjectNode objectnode = structure.retrieve(this.slideToken,
                                                           subject);

                if ( !(objectnode instanceof SubjectNode)) {
                    throw new SourceException("Principal '"+
                                              ((PrincipalSourcePermission) sourcepermission).getPrincipal()+
                                              "' doesn't exists");
                }
            } catch (SlideException se) {
                throw new SourceException("Could not retrieve object for principal '"+
                                          ((PrincipalSourcePermission) sourcepermission).getPrincipal()+
                                          "'", se);
            }

        } else if (sourcepermission instanceof GroupSourcePermission) {
            subject = config.getUsersPath()+"/"+
                      ((GroupSourcePermission) sourcepermission).getGroup();

            // Test if group exists
            try {
                ObjectNode objectnode = structure.retrieve(this.slideToken,
                                                           subject);

                if ( !(objectnode instanceof GroupNode)) {
                    throw new SourceException("Group '"+
                                              ((GroupSourcePermission) sourcepermission).getGroup()+
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.