// Create a rule using a type selector for the common
// properties.
RuleBuilder ruleBuilder =
ruleBuilderFactory.createRuleBuilder();
SimpleSelectorSequenceBuilder sequenceBuilder =
ruleBuilderFactory.createSequenceBuilder();
if (selectorSequence.getType() != null) {
sequenceBuilder.setTypeSelector(
selectorSequence.getType());
}
sequenceBuilder.addPseudoSelectors(
selectorSequence.getPath());
ruleBuilder.addSequence(sequenceBuilder);
ruleBuilder.setProperties(commonProperties);
Rule rule = ruleBuilder.getRule();