code: public void writeAttributeList(OutputStream out, AttributeList value) throws IOException {
          // AttributeList has no known sub-class.
          writeStartArray(out);
          if (value != null) {
              for (Attribute item : value.asList()) {
                  writeArrayItem(out);
                  writeStartObject(out);
                  writeStringField(out, OM_NAME, item.getName());
                  writePOJOField(out, OM_VALUE, item.getValue());
                  writeEndObject(out);
              }
          }
          writeEndArray(out);
      }
docs: Encode an AttributeList instance as JSON:
  [ {
  "name" : String,
  "value" : POJO
  }* ]
  
  @param out The stream to write JSON to
  @param value The AttributeList instance to encode. Can be null,
  but its Attribute items can't be null.
  @throws IOException If an I/O error occurs
  @see #readAttributeList(InputStream)