1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.seasar.teeda.core.util; |
17 | |
|
18 | |
import org.seasar.framework.exception.EmptyRuntimeException; |
19 | |
import org.seasar.framework.util.StringUtil; |
20 | |
import org.seasar.teeda.core.JsfConstants; |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
public class EmptyElementUtil implements JsfConstants { |
27 | |
|
28 | 1 | private static final String[] EMPTY_ELEMENT_TAGNAMES = { BASE_ELEM, |
29 | |
META_ELEM, LINK_ELEM, FRAME_ELEM, HR_ELEM, BR_ELEM, BASEFONT_ELEM, |
30 | |
PARAM_ELEM, IMG_ELEM, AREA_ELEM, INPUT_ELEM, ISINDEX_ELEM, COL_ELEM }; |
31 | |
|
32 | 0 | protected EmptyElementUtil() { |
33 | 0 | } |
34 | |
|
35 | |
public static boolean isEmptyElement(String tagName) { |
36 | 159 | if (StringUtil.isEmpty(tagName)) { |
37 | 0 | throw new EmptyRuntimeException("tagName"); |
38 | |
} |
39 | 159 | String name = tagName.toLowerCase(); |
40 | 1842 | for (int i = 0; i < EMPTY_ELEMENT_TAGNAMES.length; ++i) { |
41 | 1803 | if (EMPTY_ELEMENT_TAGNAMES[i].equals(name)) { |
42 | 120 | return true; |
43 | |
} |
44 | |
} |
45 | 39 | return false; |
46 | |
} |
47 | |
} |