Preparator preparator = new SimplePreparator(ps, inline, inlinePriority); CSSTreeParser parser = createParser(source, encoding, type, preparator, sheet, base); StyleSheet ret = type.parse(parser); lastPriority = ret.getLastMark();
/** * Parses source of given type * * @param source * Source, interpretation depends on {@code type} * @param type * Type of source provided * @param inline * InlineElement * @param inlinePriority * True when the rule should have an 'inline' (greater) priority * @return Created StyleSheet * @throws IOException * When problem with input stream occurs * @throws CSSException * When unrecoverable exception during parsing occurs */ public static StyleSheet parse(Object source, String encoding, SourceType type, Element inline, boolean inlinePriority, URL base) throws IOException, CSSException { StyleSheet sheet = (StyleSheet) CSSFactory.getRuleFactory() .createStyleSheet().unlock(); PriorityStrategy ps = new AtomicPriorityStrategy(lastPriority); Preparator preparator = new SimplePreparator(ps, inline, inlinePriority); CSSTreeParser parser = createParser(source, encoding, type, preparator, sheet, base); StyleSheet ret = type.parse(parser); lastPriority = ret.getLastMark(); return ret; }