Package rabbit.html

Examples of rabbit.html.Token


  int astart = -1;
 
  List<Token> tokens = block.getTokens ();
  int tsize = tokens.size ();
  for (int i = 0; i < tsize; i++) {
      Token t = tokens.get (i);
      if (t.getType () == TokenType.TAG) {
    Tag tag = t.getTag ();
    TagType tagtype = tag.getTagType ();
    if (tagtype == TagType.A) {
        astart = i;
        Tag atag = tag;
        int ttsize = tokens.size ();
        for (; i < ttsize; i++) {
      Token tk2 = tokens.get (i);
      if (tk2.getType () == TokenType.TAG) {
          Tag tag2 = tk2.getTag ();
          TagType t2tt = tag2.getTagType ();
          if (t2tt != null &&
        t2tt == TagType.SA)
        break;
          else if (t2tt != null &&
View Full Code Here


     * @param pos the position in the block were inserting stuff at.
     * @return the new position in the block.
     */
    protected int insertTokens (HtmlBlock block, int pos) {
  Config config = con.getProxy ().getConfig ();
  block.insertToken (new Token
         (config.getProperty
          (getClass ().getName (),
           "prefix",
           PREFIX)),
         pos++);
  if (config.getProperty (getClass ().getName (),
        "unfilteredlink",
        "true").toLowerCase ().equals ("true")) {
      Tag a = new Tag ("A");
      try {
    URL url = new URL (request.getRequestURI ());
    a.addArg ("HREF", getHref (url));
    block.insertToken (new Token (a), pos++);
    block.insertToken (new Token
           (config.getProperty (getClass ().getName (),
              "link",
              LINK)),
           pos++);
    Tag slasha = new Tag ("/A");
    block.insertToken (new Token (slasha), pos++);
      } catch (MalformedURLException e) {
    // ignore
      }
  }
  block.insertToken (new Token (config.getProperty
              (getClass ().getName (),
               "postfix",
               POSTFIX)),
         pos++);
  return pos;
View Full Code Here

     */
    public void filterHtml (HtmlBlock block) {
  List<Token> tokens = block.getTokens ();
  int tsize = tokens.size ();
  for (int i = 0; i < tsize; i++) {
      Token t = tokens.get (i);
      switch (t.getType ()) {
      case TAG:
    Tag tag = t.getTag ();
    handleTag (tag, block, i);
      }
  }
    }
View Full Code Here

TOP

Related Classes of rabbit.html.Token

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.