code: public static void writeJsonProperty(JsonWriter writer, Node node,
                                           Property property, MappingRules mapping)
              throws RepositoryException, IOException {
          if (property != null &&
                  (PropertyType.BINARY != property.getType() ||
                          mapping.propertyFormat.binary != MappingRules.PropertyFormat.Binary.skip)) {
              String name = property.getName();
              int type = property.getType();
              if (mapping.propertyFormat.scope == MappingRules.PropertyFormat.Scope.value) {
                  writer.name(name);
              } else {
                  writer.beginObject();
                  writer.name("name").value(name);
                  writer.name("value");
              }
              if (property.isMultiple()) {
                  writer.beginArray();
                  for (Value value : property.getValues()) {
                      JsonUtil.writeJsonValue(writer, node, name, value, type, mapping);
                  }
                  writer.endArray();
              } else {
                  JsonUtil.writeJsonValue(writer, node, name, property.getValue(), type, mapping);
              }
              if (mapping.propertyFormat.scope != MappingRules.PropertyFormat.Scope.value) {
                  writer.name("type").value(PropertyType.nameFromValue(type));
                  writer.name("multi").value(property.isMultiple());
                  if (mapping.propertyFormat.scope == MappingRules.PropertyFormat.Scope.definition) {
                      PropertyDefinition definition = property.getDefinition();
                      writer.name("auto").value(definition.isAutoCreated());
                      writer.name("protected").value(definition.isProtected());
                  }
                  writer.endObject();
              }
          }
      }
docs: Writes a JCR property as an JSON object: { name: ..., value: ..., type: ..., multi: ...}.
  
  @param writer   the JSON writer object (with the JSON state)
  @param property the JCR property to write
  @param mapping  the format in the JSON output
  @throws javax.jcr.RepositoryException error on accessing JCR
  @throws java.io.IOException           error on write JSON