test_class.file: ontopia-engine/src/test/java/net/ontopia/utils/BeanUtilsTest.java
test_class.identifier: BeanUtilsTest
test_case.body: @Test
    public void testToMap() {
      Map<String, String> map = BeanUtils.beanMap(new MyBean(), false);
      Assert.assertEquals("foo", map.get("foo"));
      Assert.assertEquals("3", map.get("bar"));
      Assert.assertNull(map.get("withParams"));
      Assert.assertEquals("[<MyBean>, <MyBean>]", map.get("list"));
    }
test_case.class_method_signature: BeanUtilsTest.testToMap()
test_case.full_signature: @Test public void testToMap()
test_case.identifier: testToMap
test_case.invocations: beanMap assertEquals get assertEquals get assertNull get assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testToMap()
focal_class.file: ontopia-engine/src/main/java/net/ontopia/utils/BeanUtils.java
focal_class.identifier: BeanUtils
focal_class.class_method_signature: BeanUtils.BeanUtils()
focal_class.full_signature: private  BeanUtils()
focal_class.identifier: BeanUtils
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  BeanUtils()
focal_class.class_method_signature: BeanUtils.beanMap(Object bean, boolean sorted)
focal_class.full_signature: public static Map<String, String> beanMap(Object bean, boolean sorted)
focal_class.identifier: beanMap
focal_class.modifiers: public static
focal_class.parameters: (Object bean, boolean sorted)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> beanMap(Object bean, boolean sorted)
focal_method.body: public static Map<String, String> beanMap(Object bean, boolean sorted) {
      Map<String, String> map =
              sorted ? new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER)
                     : new HashMap<String, String>();
  
      for (Method method : bean.getClass().getMethods()) {
        if (method.getName().startsWith("get") && !method.getName().equals("getClass") && (method.getReturnType() != null)) {
          try {
            Object o = method.invoke(bean);
            String name = method.getName().substring(3);
            name = name.substring(0, 1).toLowerCase() + name.substring(1);
            map.put(name, o == null ? "null" : o.toString());
          } catch (Exception e) {
            // could not get property: ignore
          }
        }
      }
      return map;
    }
focal_method.class_method_signature: BeanUtils.beanMap(Object bean, boolean sorted)
focal_method.full_signature: public static Map<String, String> beanMap(Object bean, boolean sorted)
focal_method.identifier: beanMap
focal_method.invocations: getMethods getClass startsWith getName equals getName getReturnType invoke substring getName toLowerCase substring substring put toString
focal_method.modifiers: public static
focal_method.parameters: (Object bean, boolean sorted)
focal_method.return: Map<String, String>
focal_method.signature: Map<String, String> beanMap(Object bean, boolean sorted)