tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > SOJO > Set Key Property

Set Key Property 

SOJO (Simplified Old Java Objects) is a Java framework which converts object graph into a specific structure or representation. This requires the library sojo-1.0.0.jar to be in classpath. The following example shows using PathExecuter.setKeyProperty() API.

File Name  :  
Author  :  Sudhakar KV
Email  :  [email protected]
package com.bethecoder.tutorials.sojo.tests;

import java.util.HashMap;
import java.util.Map;

import net.sf.sojo.navigation.PathExecuter;

public class SetKeyOGN {

   @param args
  public static void main(String[] argsthrows IOException {
    Map<String, Object> mapData = new HashMap<String, Object>();
    PathExecuter.setKeyProperty(mapData, "name""Sriram Kasireddi");
    PathExecuter.setKeyProperty(mapData, "age"4);

It gives the following output,
{age=2, name=Sriram, hobby=painting}
{age=4, name=Sriram Kasireddi, hobby=painting}


bl  br