Package org.webharvest.runtime.variables

Examples of org.webharvest.runtime.variables.Variable.toList()


        Pattern pattern = Pattern.compile(patternVar.toString(), flags);
       
        List resultList = new ArrayList();
       
        List bodyList = source.toList();
        Iterator it = bodyList.iterator();
        while (it.hasNext()) {
          Variable currVar = (Variable) it.next();
          String text = currVar.toString();
           
View Full Code Here


        Variable loopValue = new BodyProcessor(loopValueDef).run(scraper, context);
        debug(loopValueDef, scraper, loopValue);

        List resultList = new ArrayList();

        List list = loopValue != null ? loopValue.toList() : null;
        if (list != null) {
            Variable itemBeforeLoop = (Variable) context.get(item);
            Variable indexBeforeLoop = (Variable) context.get(index);

            List filteredList = filter != null ? createFilteredList(list, filter) : list;
View Full Code Here

                // execute the loop body
                BaseElementDef bodyDef = loopDef.getLoopBodyDef();
                Variable loopResult = bodyDef != null ? new BodyProcessor(bodyDef).run(scraper, context) : new EmptyVariable();
                debug(bodyDef, scraper, loopResult);
                if (!isEmpty) {
                    resultList.addAll( loopResult.toList() );
                }
            }

            // restores previous value of item variable
            if (item != null && itemBeforeLoop != null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.