code: public void setType(String type) {
          this.type = type;
          if (type.equals(MimeTypes.JSON)) {
              // Checks whether or not the given String is already a JSON string.
              // We apply a very simple check ({} or []).
              needSerializer = !((rendered.startsWith("{") && rendered.endsWith("}"))
                      || (rendered.startsWith("[") && rendered.endsWith("]")));
          } else if (type.equals(MimeTypes.XML)) {
              // Checks whether or not the given String is already a XML string.
              // We apply a very simple check: <>
              needSerializer = !(rendered.startsWith("<") && rendered.endsWith(">"));
          }
      }
docs: Sets the mime-type of the content stored in this renderable. If 'type' is JSON or XML,
  it checks whether the content is already JSON or XML encoded. If not, it enables the flag requiring the
  serialization. The detection is pretty basic and is based on the presence of "{}" or "[]" for JSON and "&lt;&gt;"
  for XML at the beginning and at the end of the sequence.
  
  @param type the type