DOMThemeGenerator generator = new DefaultDOMThemeGenerator();
RuleBuilderFactory ruleBuilderFactory = new RuleBuilderFactory();
RuleExtractor typeRuleExtractor = new TypeRuleExtractor(
ruleBuilderFactory);
generator.addRuleExtractor(typeRuleExtractor);
StylesClassRuleExtractorFactory stylesClassRuleExtractorFactory =
new StylesClassRuleExtractorFactoryImpl(ruleBuilderFactory);
RuleExtractor classRuleExtractor = new ClassRuleExtractor(
stylesClassRuleExtractorFactory);
generator.addRuleExtractor(classRuleExtractor);
return generator;