Package ch.ethz.inf.vs.californium

Examples of ch.ethz.inf.vs.californium.WebLink


      while ((path = scanner.findInLine("</[^>]*>")) != null) {
       
        // Trim <...>
        path = path.substring(1, path.length() - 1);
       
        WebLink link = new WebLink(path);
       
        // Read link format attributes
        String attr = null;
        while (scanner.findWithinHorizon(DELIMITER, 1)==null && (attr = scanner.findInLine(WORD))!=null) {
          if (scanner.findWithinHorizon("=", 1) != null) {
            String value = null;
            if ((value = scanner.findInLine(QUOTED_STRING)) != null) {
              value = value.substring(1, value.length()-1); // trim " "
              if (attr.equals(TITLE)) {
                link.getAttributes().addAttribute(attr, value);
              } else {
                for (String part : value.split("\\s", 0)) {
                  link.getAttributes().addAttribute(attr, part);
                }
              }
            } else if ((value = scanner.findInLine(WORD)) != null) {
              link.getAttributes().setAttribute(attr, value);
            } else if ((value = scanner.findInLine(CARDINAL)) != null) {
              link.getAttributes().setAttribute(attr, value);
            } else if (scanner.hasNext()) {
              value = scanner.next();
            }
           
          } else {
            // flag attribute without value
            link.getAttributes().addAttribute(attr);
          }
        }
       
        links.add(link);
      }
View Full Code Here

TOP

Related Classes of ch.ethz.inf.vs.californium.WebLink

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.