code: public static void writeJsonProperty(JsonWriter writer, String name,
                                           Object value, MappingRules mapping)
              throws RepositoryException, IOException {
          if (name != null && value != null) {
              int type = PropertyType.STRING;
              if (value instanceof Boolean) {
                  type = PropertyType.BOOLEAN;
              } else if (value instanceof Long || value instanceof Integer) {
                  type = PropertyType.LONG;
              } else if (value instanceof Double || value instanceof Float) {
                  type = PropertyType.DOUBLE;
              } else if (value instanceof BigDecimal) {
                  type = PropertyType.DECIMAL;
              } else if (value instanceof Calendar) {
                  type = PropertyType.DATE;
              }
              if (mapping.propertyFormat.scope != MappingRules.PropertyFormat.Scope.value) {
                  writer.beginObject();
              }
              if (mapping.propertyFormat.scope == MappingRules.PropertyFormat.Scope.value) {
                  writer.name(name);
              } else {
                  writer.name("name").value(name);
                  writer.name("value");
              }
              if (value instanceof Object[]) {
                  writer.beginArray();
                  for (Object val : (Object[]) value) {
                      JsonUtil.writeJsonValue(writer, null, name, val, type, mapping);
                  }
                  writer.endArray();
              } else {
                  JsonUtil.writeJsonValue(writer, null, name, value, type, mapping);
              }
              if (mapping.propertyFormat.scope != MappingRules.PropertyFormat.Scope.value) {
                  writer.name("type").value(PropertyType.nameFromValue(type));
                  writer.name("multi").value(value instanceof Object[]);
                  writer.endObject();
              }
          }
      }
docs: Writes a resource property (without node - probably synthetic resource)
  
  @param writer
  @param name
  @param value
  @param mapping
  @throws RepositoryException
  @throws IOException