All Downloads are FREE. Search and download functionalities are using the official Maven repository.

selenium_steps_support.service.css_class.CssClassAttributeParser.kt Maven / Gradle / Ivy

There is a newer version: 5.3.5
Show newest version
package selenium_steps_support.service.css_class

import com.google.common.base.Splitter
import java.util.regex.Pattern

object CssClassAttributeParser {

    // parsed according to https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#classes

    private val SPLITTER = Splitter.on(Pattern.compile("""[ \t\r\n\f]+"""))
                                   .omitEmptyStrings()

    fun parse(cssClassAttrValue: String): Set {
        val result = linkedSetOf()

        SPLITTER.split(cssClassAttrValue)
                .forEach { result.add(it) }

        return result
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy