Package rabbit.html

Examples of rabbit.html.HtmlBlock


  DataInputStream dis = new DataInputStream (fis);
  byte[] buf = new byte[(int)size];
  dis.readFully (buf);
  HtmlParser parser = new HtmlParser ();
  parser.setText (buf);
  HtmlBlock block = parser.parse ();
  for (Token t : block.getTokens ()) {
      System.out.print ("t.type: " + t.getType ());
      if (t.getType () == TokenType.TAG)
    System.out.print (", tag: " + t.getTag ().getType ());
      System.out.println ();
  }
View Full Code Here


      block.insertRest (buf);
      System.arraycopy (arr, 0, buf, rs, arr.length);
      arr = buf;
  }
  parser.setText (arr);
  HtmlBlock currentBlock = null;
  try {
      currentBlock = parser.parse ();
      for (HtmlFilter hf : filters)
    hf.filterHtml (currentBlock);
      currentBlock.send (out);
  } catch (HtmlParseException e) {
      getLogger ().logInfo ("Bad HTML: " + e.toString ());
      out.write (arr);
      currentBlock = null;
  }
  if (currentBlock != null && currentBlock.restSize () > 0)
      block = currentBlock;
  else
      block = null;
    }
View Full Code Here

TOP

Related Classes of rabbit.html.HtmlBlock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.