public static boolean containsKey(String key) { for (AtAtKey item : AtAtKey.values()) { if (item.getKey().equals(key)) { return true; } } return false; }
public TemplateModel get(String key) throws TemplateModelException { if (key.startsWith("@@")) { if (key.equals(AtAtKey.TEXT.getKey())) { return new SimpleScalar(getText(node)); } else if (key.equals(AtAtKey.NAMESPACE.getKey())) { String nsURI = node.getNamespaceURI(); return nsURI == null ? null : new SimpleScalar(nsURI); } else if (key.equals(AtAtKey.LOCAL_NAME.getKey())) { String localName = node.getLocalName(); if (localName == null) { } else if (key.equals(AtAtKey.MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node, buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.NESTED_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getChildNodes(), buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.QNAME.getKey())) { String qname = getQualifiedName(); return qname != null ? new SimpleScalar(qname) : null;
} else if (key.startsWith("@")) { if (key.startsWith("@@")) { if (key.equals(AtAtKey.ATTRIBUTES.getKey())) { return new NodeListModel(node.getAttributes(), this); } else if (key.equals(AtAtKey.START_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getOpeningTag((Element) node)); } else if (key.equals(AtAtKey.END_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getClosingTag((Element) node)); } else if (key.equals(AtAtKey.ATTRIBUTES_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getAttributes(), buf); return new SimpleScalar(buf.toString().trim()); } else if (key.equals(AtAtKey.PREVIOUS_SIBLING_ELEMENT.getKey())) { Node previousSibling = node.getPreviousSibling(); while (previousSibling != null && !this.isSignificantNode(previousSibling)) { } else if (key.equals(AtAtKey.NEXT_SIBLING_ELEMENT.getKey())) { Node nextSibling = node.getNextSibling(); while (nextSibling != null && !this.isSignificantNode(nextSibling)) {
public static boolean containsKey(String key) { for (AtAtKey item : AtAtKey.values()) { if (item.getKey().equals(key)) { return true; } } return false; }
public static boolean containsKey(String key) { for (AtAtKey item : AtAtKey.values()) { if (item.getKey().equals(key)) { return true; } } return false; }
public TemplateModel get(String key) throws TemplateModelException { if (key.startsWith("@@")) { if (key.equals(AtAtKey.TEXT.getKey())) { return new SimpleScalar(getText(node)); } else if (key.equals(AtAtKey.NAMESPACE.getKey())) { String nsURI = node.getNamespaceURI(); return nsURI == null ? null : new SimpleScalar(nsURI); } else if (key.equals(AtAtKey.LOCAL_NAME.getKey())) { String localName = node.getLocalName(); if (localName == null) { } else if (key.equals(AtAtKey.MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node, buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.NESTED_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getChildNodes(), buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.QNAME.getKey())) { String qname = getQualifiedName(); return qname != null ? new SimpleScalar(qname) : null;
public TemplateModel get(String key) throws TemplateModelException { if (key.startsWith("@@")) { if (key.equals(AtAtKey.TEXT.getKey())) { return new SimpleScalar(getText(node)); } else if (key.equals(AtAtKey.NAMESPACE.getKey())) { String nsURI = node.getNamespaceURI(); return nsURI == null ? null : new SimpleScalar(nsURI); } else if (key.equals(AtAtKey.LOCAL_NAME.getKey())) { String localName = node.getLocalName(); if (localName == null) { } else if (key.equals(AtAtKey.MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node, buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.NESTED_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getChildNodes(), buf); return new SimpleScalar(buf.toString()); } else if (key.equals(AtAtKey.QNAME.getKey())) { String qname = getQualifiedName(); return qname != null ? new SimpleScalar(qname) : null;
} else if (key.startsWith("@")) { if (key.startsWith("@@")) { if (key.equals(AtAtKey.ATTRIBUTES.getKey())) { return new NodeListModel(node.getAttributes(), this); } else if (key.equals(AtAtKey.START_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getOpeningTag((Element) node)); } else if (key.equals(AtAtKey.END_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getClosingTag((Element) node)); } else if (key.equals(AtAtKey.ATTRIBUTES_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getAttributes(), buf); return new SimpleScalar(buf.toString().trim()); } else if (key.equals(AtAtKey.PREVIOUS_SIBLING_ELEMENT.getKey())) { Node previousSibling = node.getPreviousSibling(); while (previousSibling != null && !this.isSignificantNode(previousSibling)) { } else if (key.equals(AtAtKey.NEXT_SIBLING_ELEMENT.getKey())) { Node nextSibling = node.getNextSibling(); while (nextSibling != null && !this.isSignificantNode(nextSibling)) {
} else if (key.startsWith("@")) { if (key.startsWith("@@")) { if (key.equals(AtAtKey.ATTRIBUTES.getKey())) { return new NodeListModel(node.getAttributes(), this); } else if (key.equals(AtAtKey.START_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getOpeningTag((Element) node)); } else if (key.equals(AtAtKey.END_TAG.getKey())) { NodeOutputter nodeOutputter = new NodeOutputter(node); return new SimpleScalar(nodeOutputter.getClosingTag((Element) node)); } else if (key.equals(AtAtKey.ATTRIBUTES_MARKUP.getKey())) { StringBuilder buf = new StringBuilder(); NodeOutputter nu = new NodeOutputter(node); nu.outputContent(node.getAttributes(), buf); return new SimpleScalar(buf.toString().trim()); } else if (key.equals(AtAtKey.PREVIOUS_SIBLING_ELEMENT.getKey())) { Node previousSibling = node.getPreviousSibling(); while (previousSibling != null && !this.isSignificantNode(previousSibling)) { } else if (key.equals(AtAtKey.NEXT_SIBLING_ELEMENT.getKey())) { Node nextSibling = node.getNextSibling(); while (nextSibling != null && !this.isSignificantNode(nextSibling)) {