1 37 package org.webharvest.runtime.processors; 38 39 import org.webharvest.definition.ReturnDef; 40 import org.webharvest.runtime.Scraper; 41 import org.webharvest.runtime.ScraperContext; 42 import org.webharvest.runtime.variables.EmptyVariable; 43 import org.webharvest.runtime.variables.IVariable; 44 45 48 public class ReturnProcessor extends BaseProcessor { 49 50 private ReturnDef returnDef; 51 52 public ReturnProcessor(ReturnDef returnDef) { 53 super(returnDef); 54 this.returnDef = returnDef; 55 } 56 57 public IVariable execute(Scraper scraper, ScraperContext context) { 58 CallProcessor callProcessor = scraper.getRunningFunction(); 59 60 if (callProcessor != null) { 61 IVariable returnValue = this.getBodyListContent(returnDef, scraper, context); 62 callProcessor.setFunctionResult( returnValue ); 63 } 64 65 return new EmptyVariable(); 66 } 67 68 } | Popular Tags |