code: @Override
      public JSONObject toJSONObject()
      {
          final JSONObject object = new JSONObject();
  
          object.put("type", new JSONString(getNodeType().getValue()));
  
          if (hasMetaData())
          {
              final MetaData meta = getMetaData();
  
              if (false == meta.isEmpty())
              {
                  object.put("meta", new JSONObject(meta.getJSO()));
              }
          }
          object.put("attributes", new JSONObject(getAttributes().getJSO()));
  
          final NFastArrayList<IPrimitive<?>> list = getChildNodes();
  
          final JSONArray children = new JSONArray();
  
          if (null != list)
          {
              final int size = list.size();
  
              for (int i = 0; i < size; i++)
              {
                  final IPrimitive<?> prim = list.get(i);
  
                  if (null != prim)
                  {
                      final JSONObject make = prim.toJSONObject();
  
                      if (null != make)
                      {
                          children.set(children.size(), make);
                      }
                  }
              }
          }
          object.put("children", children);
  
          object.put("storage", getStorageEngine().toJSONObject());
  
          return object;
      }
docs: Serializes this Layer as a {@link com.google.gwt.json.client.JSONObject}
  
  @return JSONObject