Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
BooleanAttributes |
|
| 0.0;0 |
1 | package net.sf.jolene.dom; | |
2 | ||
3 | /** | |
4 | * List of standard attributes which support attribute minimization (can be alone without an equal sign and value) | |
5 | * Jolene supports parsing and when rendering we use then xhtml format which is compatible with html 4. | |
6 | * | |
7 | * @author Dan Howard | |
8 | * @since Jul 19, 2008 4:07:56 PM | |
9 | */ | |
10 | 2490 | enum BooleanAttributes { |
11 | ||
12 | 1 | compact, nowrap, ismap, declare, noshade, checked, disabled, readonly, multiple, selected, noresize, defer; |
13 | ||
14 | // The enum valueOf throws an IllegalArgumentException instead of | |
15 | // simply returning null so we just wrap it up here. | |
16 | static BooleanAttributes fromString(String attribute) { | |
17 | 1683 | BooleanAttributes ret = null; |
18 | try { | |
19 | 1683 | ret = valueOf(attribute); |
20 | 1661 | } catch (IllegalArgumentException e) { |
21 | 22 | } |
22 | 1683 | return ret; |
23 | } | |
24 | } | |
25 |