Class ClassList<E extends Element>
java.lang.Object
org.jboss.elemento.ClassList<E>
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds one or more classes to the class list of the element.classList(E element) booleanChecks if the specified class name exists in the class list of the element.iterator()intlength()voidRemoves one or more classes from the class list of the element.voidReplaces occurrences of a class name with a new class name in the class list of the element.voidToggle the class value; i.e., if the class exists, then remove it, if not, then add it.voidAdds (force=true) or removes (force=false) the specified CSS class to the class list of the element.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
classList
-
add
Adds one or more classes to the class list of the element. Empty classes are ignored, classes with spaces are split into multiple classes. -
remove
Removes one or more classes from the class list of the element. Empty classes are ignored, classes with spaces are split into multiple classes. -
toggle
Toggle the class value; i.e., if the class exists, then remove it, if not, then add it. -
toggle
Adds (force=true) or removes (force=false) the specified CSS class to the class list of the element. -
replace
-
contains
Checks if the specified class name exists in the class list of the element.- Parameters:
classname- the class name to check for; must not be null or empty- Returns:
- true if the class name exists in the element's class list, false otherwise
-
iterator
-
length
public int length()
-