Package de.xima.fc.logic.dom
Class XDomUtils
- java.lang.Object
-
- de.xima.fc.logic.dom.XDomUtils
-
public final class XDomUtils extends Object
Helper for DOM related features.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
dataAttrDashStyle(String name)
Takes a data attribute name using dash style notation (eg.
-
-
-
Method Detail
-
dataAttrDashStyle
public static String dataAttrDashStyle(String name)
Takes a data attribute name using dash style notation (eg. `fooBarBaz`) and converts it to dash style notation (e.g. `data-foo-bar-baz`).The HTML living standard defines the conversion as follows:
To set the value of a new named property or set the value of an existing named property for a DOMStringMap, given a property name and a new value, run the following steps:
- If name contains a U+002D HYPHEN-MINUS character (-) followed by an ASCII lower alpha, then throw a "SyntaxError" DOMException.
- For each ASCII upper alpha in name, insert a U+002D HYPHEN-MINUS character (-) before the character and replace * the character with the same character converted to ASCII lowercase.
- Insert the string `data-` at the front of name.
- If name does not match the XML Name production, throw an "InvalidCharacterError" DOMException.
- Set an attribute value for the DOMStringMap's associated element using name and value.
- Parameters:
name
- Name of the data attribute using camel case notation.- Returns:
- Name of the data attribute using camel case notation.
- Throws:
IllegalArgumentException
- When the given name is invalid.
-
-