code: public void writeTagsToJavaScript(Writer writer) throws IOException
      {
          writer.append("function fillTagService(tagService) {\n");
          writer.append("\t// (name, isPrime, isPseudo, color), [parent tags]\n");
          for (Tag tag : definedTags.values())
          {
              writer.append("\ttagService.registerTag(new Tag(");
              escapeOrNull(tag.getName(), writer);
              writer.append(", ");
              escapeOrNull(tag.getTitle(), writer);
              writer.append(", ").append("" + tag.isPrime())
                          .append(", ").append("" + tag.isPseudo())
                          .append(", ");
              escapeOrNull(tag.getColor(), writer);
              writer.append(")").append(", [");
  
              // We only have strings, not references, so we're letting registerTag() getOrCreate() the tag.
              for (Tag parentTag : tag.getParentTags())
              {
                  writer.append("'").append(StringEscapeUtils.escapeEcmaScript(parentTag.getName())).append("',");
              }
              writer.append("]);\n");
          }
          writer.append("}\n");
      }
docs: Writes the JavaScript code describing the tags as Tag classes to given writer.