if (renderer instanceof HeaderResourceProducer2) {
HeaderResourceProducer2 producer = (HeaderResourceProducer2) renderer;
if (producerContext == null) {
producerContext = new ProducerContextImpl(processScripts, processStyles);
}
producer.encodeToHead(context, component, producerContext);
} else if (renderer instanceof HeaderResourceProducer) {
HeaderResourceProducer producer = (HeaderResourceProducer) renderer;