Package org.rometools.feed.module.opensearch.entity

Examples of org.rometools.feed.module.opensearch.entity.OSQuery


        return (foundSomething) ? osm : null;
    }
 
  private static OSQuery parseQuery(Element e){
   
    OSQuery query = new OSQuery();
   
        String att = e.getAttributeValue("role");
        query.setRole(att);
       
        att = e.getAttributeValue("osd");
    query.setOsd(att);
       
        att = e.getAttributeValue("searchTerms");
    query.setSearchTerms(att);
           
        att = e.getAttributeValue("title");
    query.setTitle(att);
       
    try{

      // someones mistake should not cause the parser to fail, since these are only optional attributes
     
      att = e.getAttributeValue("totalResults");
          if(att != null){
            query.setTotalResults(Integer.parseInt(att));
          }
         
          att = e.getAttributeValue("startPage");
      if(att != null){
              query.setStartPage(Integer.parseInt(att));
      }
     
    } catch(NumberFormatException ex){
      System.err.println("Warning: Exception caught while trying to parse a non-numeric Query attribute " + ex.getMessage());
    }
View Full Code Here


        if(osm.getQueries() != null){
         
          List queries = osm.getQueries();
         
          for (Iterator iter = queries.iterator(); iter.hasNext();) {
        OSQuery query = (OSQuery) iter.next();
        if(query != null){
              element.addContent(generateQueryElement(query));
        }
      }
        }         
View Full Code Here

TOP

Related Classes of org.rometools.feed.module.opensearch.entity.OSQuery

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.