Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java @ 1890:9144e5a5027b
(Picky) cosmetics.
flys-artifacts/trunk@3250 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 15 Nov 2011 14:15:31 +0000 |
parents | 755d9763928f |
children | 5642a83420f2 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java Tue Nov 15 14:10:21 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java Tue Nov 15 14:15:31 2011 +0000 @@ -130,6 +130,9 @@ statements.clear(); } + /** + * Handle a \<context\> node. + */ protected void context(Node parent, Element current) throws SQLException { @@ -144,7 +147,7 @@ Node node = subs.item(i); String ns; if (node.getNodeType() == Node.ELEMENT_NODE - && node.getLocalName().equals("statement") + && node.getLocalName().equals("statement") && (ns = node.getNamespaceURI()) != null && ns.equals(DC_NAMESPACE_URI)) { stmntNode = node; @@ -157,10 +160,10 @@ return; } + String stmntText = stmntNode.getTextContent(); + String con = current.getAttribute("connection"); - String stmntText = stmntNode.getTextContent(); - String key = con + "-" + stmntText; CompiledStatement.Instance csi = statements.get(key); @@ -203,6 +206,9 @@ } } + /** + * Kind of foreach over results of a statement within a context. + */ protected void elements(Node parent, Element current) throws SQLException { @@ -247,6 +253,9 @@ } } + /** + * Create element. + */ protected void element(Node parent, Element current) throws SQLException { @@ -279,7 +288,10 @@ parent.appendChild(owner.createTextNode(value)); } - + /** + * Add attribute to an element + * @see element + */ protected void attribute(Node parent, Element current) { if (parent.getNodeType() != Node.ELEMENT_NODE) { @@ -309,7 +321,7 @@ DC_NAMESPACE_URI, "macro"); for (int i = 0, N = macros.getLength(); i < N; ++i) { - Element macro = (Element)macros.item(i); + Element macro = (Element) macros.item(i); if (name.equals(macro.getAttribute("name"))) { NodeList subs = macro.getChildNodes(); for (int j = 0, M = subs.getLength(); j < M; ++j) {