code: public void parse(CharSequence in, FutureAppendable out) throws IOException, HttpErrorPage {
          FutureParserContextImpl ctx = new FutureParserContextImpl(out, this.httpRequest, this.httpResponse, this.data);
          Matcher matcher = this.pattern.matcher(in);
          int currentPosition = 0;
          while (matcher.find()) {
              String tag = matcher.group();
              ctx.characters(new CharSequenceFuture(in.subSequence(currentPosition, matcher.start())));
              currentPosition = matcher.end();
              if (ctx.isCurrentTagEnd(tag)) {
                  // check if this is the end tag for current element
                  LOG.info("Processing end tag {}", tag);
                  ctx.endElement(tag);
              } else {
                  // if not, it is an opening tag for a new element
                  LOG.info("Processing start tag {}", tag);
                  FutureElementType type = null;
                  for (FutureElementType t : this.elementTypes) {
                      if (t.isStartTag(tag)) {
                          type = t;
                          break;
                      }
                  }
                  FutureElement element = type.newInstance();
                  ctx.startElement(type, element, tag);
                  if (type.isSelfClosing(tag)) {
                      ctx.endElement(tag);
                  }
              }
          }
          // we reached the end of input
          ctx.characters(new CharSequenceFuture(in.subSequence(currentPosition, in.length())));
      }
docs: Parses all the CharSequence.
  
  @param in
  The CharSequence to parse
  @param out
  The Writable to write the result to
  @throws IOException
  @throws HttpErrorPage