Searches all sub-nodes of this node for jsp:attribute standard actions with the given name. This should always be called and only be called for nodes that accept dynamic runtime attribute expressions. @param name The name of the attribute @return the NamedAttribute node of the matching named a
(String name)
| 288 | * @return the NamedAttribute node of the matching named attribute, nor null if no such node is found. |
| 289 | */ |
| 290 | public NamedAttribute getNamedAttributeNode(String name) { |
| 291 | NamedAttribute result = null; |
| 292 | |
| 293 | // Look for the attribute in NamedAttribute children |
| 294 | Nodes nodes = getNamedAttributeNodes(); |
| 295 | int numChildNodes = nodes.size(); |
| 296 | for (int i = 0; i < numChildNodes; i++) { |
| 297 | NamedAttribute na = (NamedAttribute) nodes.getNode(i); |
| 298 | boolean found; |
| 299 | int index = name.indexOf(':'); |
| 300 | if (index != -1) { |
| 301 | // qualified name |
| 302 | found = na.getName().equals(name); |
| 303 | } else { |
| 304 | found = na.getLocalName().equals(name); |
| 305 | } |
| 306 | if (found) { |
| 307 | result = na; |
| 308 | break; |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | return result; |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * Searches all subnodes of this node for jsp:attribute standard actions, and returns that set of nodes as a |
no test coverage detected