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;
}