public class Analyzer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Analyzer.Holder
Holds list of maps of list.
|
protected static class |
Analyzer.HolderItem
Decides about holder item
|
protected static class |
Analyzer.HolderSelector
Holds holder item type and key value, that is two elements that are about
to be used for storing in holder
|
static class |
Analyzer.OrderedRule
Represents a ruleset and its order in the corresponding style sheet.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentOrder
Rule order counter
|
protected Analyzer.Holder |
rules
Holds maps of declared rules classified into groups of
HolderItem (ID, CLASS, ELEMENT, OTHER).
|
protected List<StyleSheet> |
sheets
The style sheets to be processed.
|
| 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,
MediaSpec media,
boolean inherit)
Creates map of declarations assigned to each element of a DOM tree
|
protected void |
classifyAllSheets(MediaSpec mediaspec)
Classifies the rules in all the style sheets.
|
protected boolean |
elementSelectorMatches(Selector s,
Element e) |
StyleMap |
evaluateDOM(Document doc,
MediaSpec media,
boolean inherit)
Evaluates CSS properties of DOM tree
|
StyleMap |
evaluateDOM(Document doc,
String media,
boolean inherit) |
ElementMatcher |
getElementMatcher()
Obtains the matcher to be used for matching the elements.
|
MatchCondition |
getMatchCondition()
Obtains the match condition to be used for matching the elements and
selector parts.
|
protected boolean |
matchSelector(CombinedSelector sel,
Element e,
org.w3c.dom.traversal.TreeWalker w) |
void |
registerElementMatcher(ElementMatcher matcher)
Registers a new element matcher to be used for matching the elements and
selector parts.
|
void |
registerMatchCondition(MatchCondition matchCond)
Registers a new match condition to be used for matching the elements and
selector parts.
|
protected List<StyleSheet> sheets
protected int currentOrder
protected 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 final void registerMatchCondition(MatchCondition matchCond)
matchCond - the new match conditionpublic final MatchCondition getMatchCondition()
public final void registerElementMatcher(ElementMatcher matcher)
matcher - the new element matcherpublic final ElementMatcher getElementMatcher()
public StyleMap evaluateDOM(Document doc, MediaSpec media, boolean inherit)
doc - Document treemedia - Mediainherit - Use inheritanceprotected DeclarationMap assingDeclarationsToDOM(Document doc, MediaSpec 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)
protected void classifyAllSheets(MediaSpec mediaspec)
mediaspec - The specification of the media for evaluating the media queries.Copyright © 2018. All rights reserved.