+ if (property != null)
+ return propertyValues(property);
+
+ Node child = null;
+ if (!node.hasNode(key)) {
+ List<Node> children = new ArrayList<>();
+ NodeIterator nit = node.getNodes("*:" + key);
+ while (nit.hasNext())
+ children.add(nit.nextNode());
+ if (children.size() > 1)
+ throw new TemplateModelException(
+ "Too many properties match " + key + " (" + children + "), use prefix with \\: escape");
+ if (!children.isEmpty())
+ child = children.get(0);
+ } else
+ child = node.getNode(key);
+ if (child != null)
+ return new JcrModel(child);
+ return null;
+