Class CssInlineImpl
java.lang.Object
ch.tocco.nice2.toolbox.impl.css.CssInlineImpl
- All Implemented Interfaces:
CssInline
-
Nested Class Summary
Nested classes/interfaces inherited from interface CssInline
CssInline.PropertyValue, CssInline.Rule, CssInline.RuleSelector -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetElementStyles(String html, String selector, Predicate<CssInline.Rule> ruleFilter) Moves the CSS rules from the<style>blocks in the document head to the elements and returns all styles of the first element that matches the selector.Moves the CSS rules from the<style>blocks in the document head to the elements.voidsetNewParser(boolean newParser)
-
Constructor Details
-
CssInlineImpl
public CssInlineImpl()
-
-
Method Details
-
setNewParser
@Value("${cssinline.newparser}") public void setNewParser(boolean newParser) -
inlineCss
Description copied from interface:CssInlineMoves the CSS rules from the<style>blocks in the document head to the elements. It always returns a complete html document (with<html>root tag), even if given only a html snippet. -
getElementStyles
public Map<String,String> getElementStyles(String html, String selector, Predicate<CssInline.Rule> ruleFilter) Description copied from interface:CssInlineMoves the CSS rules from the<style>blocks in the document head to the elements and returns all styles of the first element that matches the selector. Only the rules for which the givenruleFilterpredicate returnstrueare inlined.- Specified by:
getElementStylesin interfaceCssInline- Parameters:
html- HTML string with styles in document headselector- The element to select (styles for first matching element are returned)ruleFilter- Only rules for which this predicate returnstrueare inlined- Returns:
- all styles of the first element that matches the selector.
-