/** * Selects a single node from this model's nodelist by its list index and * returns a new NodeListModel containing that single node. * @param index the ordinal number of the selected node * @see freemarker.template.TemplateSequenceModel#get(int) */ public TemplateModel get(int index) { return deriveModel(Collections.singletonList(nodes.get(index))); }
/** * Evaluates an XPath expression on XML nodes in this model. * @param arguments the arguments to the method invocation. Expectes exactly * one argument - the XPath expression. * @return a new NodeListModel with nodes selected by applying the XPath * expression to this model's nodelist. * @see freemarker.template.TemplateMethodModel#exec(List) */ public Object exec(List arguments) throws TemplateModelException { if (arguments.size() != 1) { throw new TemplateModelException( "Expecting exactly one argument - an XPath expression"); } return deriveModel(navigator.applyXPath(nodes, (String) arguments.get(0), namespaces)); }
return deriveModel(removeDuplicates(nodes)); } else if (key.equals("_filterType") || key.equals("_ftype")) { return new FilterByType(); return deriveModel(result);
/** * Selects a single node from this model's nodelist by its list index and * returns a new NodeListModel containing that single node. * @param index the ordinal number of the selected node * @see freemarker.template.TemplateSequenceModel#get(int) */ public TemplateModel get(int index) { return deriveModel(Collections.singletonList(nodes.get(index))); }
/** * Selects a single node from this model's nodelist by its list index and * returns a new NodeListModel containing that single node. * @param index the ordinal number of the selected node * @see freemarker.template.TemplateSequenceModel#get(int) */ public TemplateModel get(int index) { return deriveModel(Collections.singletonList(nodes.get(index))); }
/** * Selects a single node from this model's nodelist by its list index and * returns a new NodeListModel containing that single node. * @param index the ordinal number of the selected node * @see freemarker.template.TemplateSequenceModel#get(int) */ public TemplateModel get(int index) { return deriveModel(Collections12.singletonList(nodes.get(index))); }
/** * Evaluates an XPath expression on XML nodes in this model. * @param arguments the arguments to the method invocation. Expectes exactly * one argument - the XPath expression. * @return a new NodeListModel with nodes selected by applying the XPath * expression to this model's nodelist. * @see freemarker.template.TemplateMethodModel#exec(List) */ public Object exec(List arguments) throws TemplateModelException { if (arguments.size() != 1) { throw new TemplateModelException( "Expecting exactly one argument - an XPath expression"); } return deriveModel(navigator.applyXPath(nodes, (String) arguments.get(0), namespaces)); }
/** * Evaluates an XPath expression on XML nodes in this model. * @param arguments the arguments to the method invocation. Expectes exactly * one argument - the XPath expression. * @return a new NodeListModel with nodes selected by applying the XPath * expression to this model's nodelist. * @see freemarker.template.TemplateMethodModel#exec(List) */ public Object exec(List arguments) throws TemplateModelException { if (arguments.size() != 1) { throw new TemplateModelException( "Expecting exactly one argument - an XPath expression"); } return deriveModel(navigator.applyXPath(nodes, (String) arguments.get(0), namespaces)); }
/** * Evaluates an XPath expression on XML nodes in this model. * @param arguments the arguments to the method invocation. Expectes exactly * one argument - the XPath expression. * @return a new NodeListModel with nodes selected by applying the XPath * expression to this model's nodelist. * @see freemarker.template.TemplateMethodModel#exec(List) */ public Object exec(List arguments) throws TemplateModelException { if(arguments.size() != 1) { throw new TemplateModelException( "Expecting exactly one argument - an XPath expression"); } return deriveModel(navigator.applyXPath(nodes, (String)arguments.get(0), namespaces)); }
return deriveModel(removeDuplicates(nodes)); return deriveModel(result);
return deriveModel(removeDuplicates(nodes)); } else if (key.equals("_filterType") || key.equals("_ftype")) { return new FilterByType(); return deriveModel(result);
return deriveModel(removeDuplicates(nodes)); } else if (key.equals("_filterType") || key.equals("_ftype")) { return new FilterByType(); return deriveModel(result);