public FaceletsConfiguration getFaceletsConfiguration() { if (null == faceletsConfig) { faceletsConfig = new FaceletsConfiguration(this); } return faceletsConfig; }
public boolean isOutputHtml5Doctype(String alias) { boolean currentModeIsHtml5 = true; String extension = getExtension(alias); assert (null != faceletsProcessingMappings); if (faceletsProcessingMappings.containsKey(extension)) { String value = faceletsProcessingMappings.get(extension); currentModeIsHtml5 = value.equals("html5"); } return currentModeIsHtml5; }
public static FaceletsConfiguration getInstance() { FacesContext context = FacesContext.getCurrentInstance(); return FaceletsConfiguration.getInstance(context); }
facelets.isProcessCurrentDocumentAsFaceletsXhtml(alias); if (this.inDocument && (processAsXhtml || facelets.isOutputHtml5Doctype(alias))) { boolean isHtml5 = facelets.isOutputHtml5Doctype(alias);
@Override public void write(FacesContext context) throws IOException { if (FaceletsConfiguration.getInstance(context).isEscapeInlineText(context)) { context.getResponseWriter().writeText(this.text, null); } else { context.getResponseWriter().write(this.text); } }
@Override public void encodeBegin(FacesContext context, UIComponent component) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("head", component); RenderKitUtils.renderPassThruAttributes(context, writer, component, HEAD_ATTRIBUTES); WebConfiguration webConfig = WebConfiguration.getInstance(context.getExternalContext()); FaceletsConfiguration faceletsConfig = webConfig.getFaceletsConfiguration(); if (faceletsConfig.isOutputHtml5Doctype(context.getViewRoot().getViewId())) { String clientId = component.getClientId(context); writer.writeAttribute("id", clientId, "clientId"); } }
public void startCDATA() throws SAXException { if (this.inDocument) { if (!unit.getWebConfiguration().getFaceletsConfiguration().isConsumeCDATA(alias)) { this.unit.writeInstruction("<![CDATA["); } } }
@Override public void processingInstruction(String target, String data) throws SAXException { if (this.inDocument) { // If there is a process-as value for the extension, only allow // the PI to be written if its value is xhtml boolean processAsXhtml = this.unit.getWebConfiguration().getFaceletsConfiguration().isProcessCurrentDocumentAsFaceletsXhtml(alias); if (processAsXhtml) { StringBuffer sb = new StringBuffer(64); sb.append("<?").append(target).append(' ').append(data).append( "?>\n"); this.unit.writeInstruction(sb.toString()); } } }
public void comment(char[] ch, int start, int length) throws SAXException { if (this.inDocument) { if (!unit.getWebConfiguration().getFaceletsConfiguration().isConsumeComments(alias)) { this.unit.writeComment(new String(ch, start, length)); } } }
facelets.isProcessCurrentDocumentAsFaceletsXhtml(alias); if (this.inDocument && (processAsXhtml || facelets.isOutputHtml5Doctype(alias))) { boolean isHtml5 = facelets.isOutputHtml5Doctype(alias);
public void write(FacesContext context) throws IOException { if (FaceletsConfiguration.getInstance(context).isEscapeInlineText(context)) { context.getResponseWriter().writeText(this.text, null); } else { context.getResponseWriter().write(this.text); } }
@Override public void encodeBegin(FacesContext context, UIComponent component) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("head", component); RenderKitUtils.renderPassThruAttributes(context, writer, component, HEAD_ATTRIBUTES); WebConfiguration webConfig = WebConfiguration.getInstance(context.getExternalContext()); FaceletsConfiguration faceletsConfig = webConfig.getFaceletsConfiguration(); if (faceletsConfig.isOutputHtml5Doctype(context.getViewRoot().getViewId())) { String clientId = component.getClientId(context); writer.writeAttribute("id", clientId, "clientId"); } }
@Override public void endCDATA() throws SAXException { if (this.inDocument) { if (!unit.getWebConfiguration().getFaceletsConfiguration().isConsumeCDATA(alias)) { this.unit.writeInstruction("]]>"); } } }
public void processingInstruction(String target, String data) throws SAXException { if (this.inDocument) { // If there is a process-as value for the extension, only allow // the PI to be written if its value is xhtml boolean processAsXhtml = this.unit.getWebConfiguration().getFaceletsConfiguration().isProcessCurrentDocumentAsFaceletsXhtml(alias); if (processAsXhtml) { StringBuffer sb = new StringBuffer(64); sb.append("<?").append(target).append(' ').append(data).append( "?>\n"); this.unit.writeInstruction(sb.toString()); } } }
@Override public void comment(char[] ch, int start, int length) throws SAXException { if (this.inDocument) { if (!unit.getWebConfiguration().getFaceletsConfiguration().isConsumeComments(alias)) { this.unit.writeComment(new String(ch, start, length)); } } }
facelets.isProcessCurrentDocumentAsFaceletsXhtml(alias); if (this.inDocument && (processAsXhtml || facelets.isOutputHtml5Doctype(alias))) { boolean isHtml5 = facelets.isOutputHtml5Doctype(alias);
public boolean isOutputHtml5Doctype(String alias) { boolean currentModeIsHtml5 = true; String extension = getExtension(alias); assert (null != faceletsProcessingMappings); if (faceletsProcessingMappings.containsKey(extension)) { String value = faceletsProcessingMappings.get(extension); currentModeIsHtml5 = value.equals("html5"); } return currentModeIsHtml5; }
@Override public void write(FacesContext context) throws IOException { if (FaceletsConfiguration.getInstance(context).isEscapeInlineText(context)) { context.getResponseWriter().writeText(this.text, null); } else { context.getResponseWriter().write(this.text); } }
@Override public void encodeBegin(FacesContext context, UIComponent component) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("head", component); RenderKitUtils.renderPassThruAttributes(context, writer, component, HEAD_ATTRIBUTES); WebConfiguration webConfig = WebConfiguration.getInstance(context.getExternalContext()); FaceletsConfiguration faceletsConfig = webConfig.getFaceletsConfiguration(); if (faceletsConfig.isOutputHtml5Doctype(context.getViewRoot().getViewId())) { String clientId = component.getClientId(context); writer.writeAttribute("id", clientId, "clientId"); } }
@Override public void startCDATA() throws SAXException { if (this.inDocument) { if (!unit.getWebConfiguration().getFaceletsConfiguration().isConsumeCDATA(alias)) { this.unit.writeInstruction("<![CDATA["); } } }