| 1942 | } |
| 1943 | |
| 1944 | @SuppressWarnings("unchecked") |
| 1945 | private static Object escape(Object o) { |
| 1946 | if (o instanceof List) { |
| 1947 | for (ListIterator<Object> it = ((List<Object>) o).listIterator(); it.hasNext(); ) { |
| 1948 | it.set(escape(it.next())); |
| 1949 | } |
| 1950 | } else if (o instanceof String) { |
| 1951 | String str = (String) o; |
| 1952 | o = HtmlUtil.escape(str, "div", "span"); |
| 1953 | } else { |
| 1954 | throw new IllegalStateException("unexpected object type: "+o.getClass()); |
| 1955 | } |
| 1956 | |
| 1957 | return o; |
| 1958 | } |
| 1959 | |
| 1960 | /** |
| 1961 | * The type of internal names (see {@link Type#getInternalName()}). See {@link #appendDescriptor}. |