- java.lang.Object
-
- jakarta.faces.render.Renderer
-
- org.omnifaces.renderer.CriticalStylesheetRenderer
-
public class CriticalStylesheetRenderer extends Renderer
This renderer is the default renderer ofCriticalStylesheet
.- Since:
- 4.5
- Author:
- Bauke Scholtz
-
-
Field Summary
Fields Modifier and Type Field Description static String
RENDERER_TYPE
The standard renderer type.-
Fields inherited from class jakarta.faces.render.Renderer
PASSTHROUGH_RENDERER_LOCALNAME_KEY
-
-
Constructor Summary
Constructors Constructor Description CriticalStylesheetRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
encodeBegin(FacesContext context, UIComponent component)
Writes a<link rel="preload" as="style">
element with ahref
attribute representingResource.getRequestPath()
.void
encodeEnd(FacesContext context, UIComponent component)
Ends the<link>
and writes a<noscript>
with a "plain vanilla"<link rel="stylesheet">
-
Methods inherited from class jakarta.faces.render.Renderer
convertClientId, decode, encodeChildren, getConvertedValue, getRendersChildren
-
-
-
-
Field Detail
-
RENDERER_TYPE
public static final String RENDERER_TYPE
The standard renderer type.- See Also:
- Constant Field Values
-
-
Method Detail
-
encodeBegin
public void encodeBegin(FacesContext context, UIComponent component) throws IOException
Writes a<link rel="preload" as="style">
element with ahref
attribute representingResource.getRequestPath()
. If the resource is not resolvable, then aRES_NOT_FOUND
will be written to thehref
attribute instead.- Overrides:
encodeBegin
in classRenderer
- Throws:
IOException
-
encodeEnd
public void encodeEnd(FacesContext context, UIComponent component) throws IOException
Ends the<link>
and writes a<noscript>
with a "plain vanilla"<link rel="stylesheet">
- Overrides:
encodeEnd
in classRenderer
- Throws:
IOException
-
-