Examples of EmptyVariable


Examples of org.webharvest.runtime.variables.EmptyVariable

                    context.put( index, new NodeVariable(String.valueOf(i)) );
                }

                // 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) {
                context.put(item, itemBeforeLoop);
            }

            // restores previous value of index variable
            if (index != null && indexBeforeLoop != null) {
                context.put(index, indexBeforeLoop);
            }
        }

        return isEmpty ? new EmptyVariable() : new ListVariable(resultList);
    }
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.