public class Analyzer extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Analyzer.Holder
Holds list of maps of list.
|
protected static class |
Analyzer.HolderItem
Decides about holder item
|
protected class |
Analyzer.HolderSelector
Holds holder item type and key value, that is two elements that are about
to be used for storing in holder
|
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Analyzer.Holder> |
rules
For all medias holds maps of declared rules classified into groups of
HolderItem (ID, CLASS, ELEMENT, OTHER).
|
protected static String |
UNIVERSAL_HOLDER |
| Constructor and Description |
|---|
Analyzer(List<StyleSheet> sheets)
Creates the analyzer for multiple style sheets.
|
Analyzer(StyleSheet sheet)
Creates the analyzer for a single style sheet.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
assignDeclarationsToElement(DeclarationMap declarations,
org.w3c.dom.traversal.TreeWalker walker,
Element e,
Analyzer.Holder holder)
Assigns declarations to one element.
|
protected DeclarationMap |
assingDeclarationsToDOM(Document doc,
String media,
boolean inherit)
Creates map of declarations assigned to each element of a DOM tree
|
StyleMap |
evaluateDOM(Document doc,
String media,
boolean inherit)
Evaluates CSS properties of DOM tree
|
protected boolean |
matchSelector(CombinedSelector sel,
Element e,
org.w3c.dom.traversal.TreeWalker w) |
protected static final String UNIVERSAL_HOLDER
protected Map<String,Analyzer.Holder> rules
public Analyzer(StyleSheet sheet)
sheet - The stylesheet that will be used as the source of rules.public Analyzer(List<StyleSheet> sheets)
sheets - A list of stylesheets that will be used as the source of rules.public StyleMap evaluateDOM(Document doc, String media, boolean inherit)
doc - Document treemedia - Mediainherit - Use inheritanceprotected DeclarationMap assingDeclarationsToDOM(Document doc, String media, boolean inherit)
doc - DOM documentmedia - Media type to be used for declarationsinherit - Inheritance (cascade propagation of values)protected void assignDeclarationsToElement(DeclarationMap declarations, org.w3c.dom.traversal.TreeWalker walker, Element e, Analyzer.Holder holder)
declarations - Declarations of all processed elementswalker - Tree walkere - DOM Elementholder - Wrapprotected boolean matchSelector(CombinedSelector sel, Element e, org.w3c.dom.traversal.TreeWalker w)
Copyright © 2014. All rights reserved.