com.mebigfatguy.tomailer
Class CssParser

java.lang.Object
  extended by com.mebigfatguy.tomailer.CssParser

public class CssParser
extends java.lang.Object

parses a css block that is found in between style tags, or referenced from an external link tag.


Constructor Summary
CssParser()
           
 
Method Summary
 void add(java.lang.String cssBlock)
          takes a block of css, and parses out individual rules, and adds them to a collection of rules found.
 CssItem[] prioritizeCss()
          sorts the css based on how specific the rules are.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CssParser

public CssParser()
Method Detail

add

public void add(java.lang.String cssBlock)
takes a block of css, and parses out individual rules, and adds them to a collection of rules found.

Parameters:
cssBlock - text that represents a set of rules found in a style block

prioritizeCss

public CssItem[] prioritizeCss()
sorts the css based on how specific the rules are. Rules applied to ids are highest, followed by classes, paths and single elements.

Returns:
a sorted list of css items


Copyright © 2009 MeBigFatGuy.com. All Rights Reserved.