*/
@SuppressWarnings("unchecked")
public Object exec(List args) throws TemplateModelException {
if(args.size() != 1){
logger.error("Received wrong number of arguments.");
throw new TemplateModelException("Wrong number of arguments. Expected args size of 1, but received " + args.size());
}
String htmlCode = null;
if(args.get(0) instanceof StringModel){
htmlCode = ((StringModel)args.get(0)).getAsString();
}else if(args.get(0) instanceof SimpleScalar){
htmlCode = ((SimpleScalar)args.get(0)).getAsString();
}else{
logger.error("Not a StringModel or SimpleScalar");
throw new TemplateModelException("Argument is not an instance of StringModel or SimpleScalar");
}
if(htmlCode == null){
logger.error("Can't scrape text from html code because the input is null");
throw new NullPointerException("htmlCode is null");
}