A custom action is considered to have an empty body if any of the following hold true: getBody() returns null all immediate children are jsp:attribute actions the action's jsp:body is empty @return true if this custom action has an empty body, and {@cod
()
| 2139 | * @return {@code true} if this custom action has an empty body, and {@code false} otherwise. |
| 2140 | */ |
| 2141 | public boolean hasEmptyBody() { |
| 2142 | boolean hasEmptyBody = true; |
| 2143 | Nodes nodes = getBody(); |
| 2144 | if (nodes != null) { |
| 2145 | int numChildNodes = nodes.size(); |
| 2146 | for (int i = 0; i < numChildNodes; i++) { |
| 2147 | Node n = nodes.getNode(i); |
| 2148 | if (!(n instanceof NamedAttribute)) { |
| 2149 | if (n instanceof JspBody) { |
| 2150 | hasEmptyBody = (n.getBody() == null); |
| 2151 | } else { |
| 2152 | hasEmptyBody = false; |
| 2153 | } |
| 2154 | break; |
| 2155 | } |
| 2156 | } |
| 2157 | } |
| 2158 | |
| 2159 | return hasEmptyBody; |
| 2160 | } |
| 2161 | } |
| 2162 | |
| 2163 | /** |
no test coverage detected