Package org.rometools.feed.module.slash

Examples of org.rometools.feed.module.slash.SlashImpl


    public String getNamespaceUri() {
  return Slash.URI;
    }

    public Module parse(Element element) {
  SlashImpl si = new SlashImpl();
  Element tag = element.getChild( "hit_parade", SlashModuleParser.NS);
  if( tag!= null ){
      StringTokenizer tok = new StringTokenizer( tag.getText() , ",");
      Integer[] hp = new Integer[tok.countTokens() ];
      for(int i=0; tok.hasMoreTokens(); i++ ){
    hp[i] = new Integer( tok.nextToken() );
      }
      si.setHitParade( hp );
  }
  tag = null;
  tag = element.getChild("comments", SlashModuleParser.NS);
  if(tag != null ){
      si.setComments( new Integer( tag.getText() ));
  }
  tag = null;
  tag = element.getChild("department", SlashModuleParser.NS);
  if( tag != null ){
      si.setDepartment( tag.getText().trim() );
  }
  tag = null;
  tag = element.getChild("section", SlashModuleParser.NS);
  if( tag!= null ){
      si.setSection( tag.getText().trim());
  }
  if( si.getHitParade() != null || si.getComments() != null ||
      si.getDepartment() !=null || si.getSection() != null ){
      return si;
  }
  return null;
    }
View Full Code Here

TOP

Related Classes of org.rometools.feed.module.slash.SlashImpl

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.