public AbstractCSSRuleImpl parseRule ( final String rule ) throws IOException { try ( InputSource source = new InputSource ( new StringReader ( rule ) ) ) { final CSSOMHandler handler = new CSSOMHandler ( ) ; parser_ . setDocumentHandler ( handler ) ; parser_ . parseRule ( source ) ; return ( AbstractCSSRuleImpl ) handler . getRoot ( ) ; } }
Parses a string into a CSSRule .