01: /*
02: * Created on 18 Sep 2006
03: */
04: package uk.org.ponder.rsf.renderer.html;
05:
06: import java.util.Map;
07:
08: import uk.org.ponder.rsf.content.ContentTypeInfoRegistry;
09: import uk.org.ponder.rsf.template.ContentTypedTPI;
10: import uk.org.ponder.rsf.template.XMLLump;
11:
12: public class HeadInferringTPI implements ContentTypedTPI {
13:
14: public String[] getInterceptedContentTypes() {
15: return new String[] { ContentTypeInfoRegistry.HTML,
16: ContentTypeInfoRegistry.HTML_FRAGMENT };
17: }
18:
19: public void adjustAttributes(String tag, Map attributes) {
20: if (tag.equals("head")
21: && attributes.get(XMLLump.ID_ATTRIBUTE) == null) {
22: attributes.put(XMLLump.ID_ATTRIBUTE, XMLLump.SCR_PREFIX
23: + HeadCollectingSCR.NAME);
24: }
25: }
26: }
|