1 37 package org.webharvest.runtime.processors; 38 39 import org.webharvest.definition.VarDefDef; 40 import org.webharvest.runtime.Scraper; 41 import org.webharvest.runtime.ScraperContext; 42 import org.webharvest.runtime.templaters.BaseTemplater; 43 import org.webharvest.runtime.variables.IVariable; 44 45 48 public class VarDefProcessor extends BaseProcessor { 49 50 private VarDefDef varDef; 51 52 public VarDefProcessor(VarDefDef varDef) { 53 super(varDef); 54 this.varDef = varDef; 55 } 56 57 public IVariable execute(Scraper scraper, ScraperContext context) { 58 IVariable var = getBodyListContent(varDef, scraper, context); 59 60 String name = BaseTemplater.execute( varDef.getName(), scraper.getScriptEngine() ); 61 62 context.put(name, var); 63 64 return var; 65 } 66 67 } | Popular Tags |