Package org.omnifaces.renderer
Class InlineResourceRenderer
- java.lang.Object
-
- jakarta.faces.render.Renderer
-
- org.omnifaces.renderer.InlineResourceRenderer
-
- Direct Known Subclasses:
InlineScriptRenderer
,InlineStylesheetRenderer
public abstract class InlineResourceRenderer extends Renderer
Base renderer which is to be shared between inline CSS and JS renderers.- Since:
- 1.2
- Author:
- Bauke Scholtz
- See Also:
CombinedResourceHandler
-
-
Field Summary
-
Fields inherited from class jakarta.faces.render.Renderer
PASSTHROUGH_RENDERER_LOCALNAME_KEY
-
-
Constructor Summary
Constructors Constructor Description InlineResourceRenderer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
encodeChildren(FacesContext context, UIComponent component)
Obtain the resource, construct aReader
around it using the character encoding as obtained from the response writer and then invokestartElement(ResponseWriter, UIComponent)
,writeResource(Reader, ResponseWriter)
andendElement(ResponseWriter)
in sequence.abstract void
endElement(ResponseWriter writer)
End the element.boolean
getRendersChildren()
Returnstrue
.abstract void
startElement(ResponseWriter writer, UIComponent component)
Start the element.abstract void
writeResource(Reader reader, ResponseWriter writer)
Write the resource inline.-
Methods inherited from class jakarta.faces.render.Renderer
convertClientId, decode, encodeBegin, encodeEnd, getConvertedValue
-
-
-
-
Method Detail
-
getRendersChildren
public boolean getRendersChildren()
Returnstrue
.- Overrides:
getRendersChildren
in classRenderer
-
encodeChildren
public void encodeChildren(FacesContext context, UIComponent component) throws IOException
Obtain the resource, construct aReader
around it using the character encoding as obtained from the response writer and then invokestartElement(ResponseWriter, UIComponent)
,writeResource(Reader, ResponseWriter)
andendElement(ResponseWriter)
in sequence.- Overrides:
encodeChildren
in classRenderer
- Throws:
IOException
-
startElement
public abstract void startElement(ResponseWriter writer, UIComponent component) throws IOException
Start the element.- Parameters:
writer
- The response writer.component
- TheUIComponent
to which this element corresponds.- Throws:
IOException
- When an I/O error occurs.
-
writeResource
public abstract void writeResource(Reader reader, ResponseWriter writer) throws IOException
Write the resource inline.- Parameters:
reader
- The reader providing the resource content.writer
- The response writer where the resource content has to be written to.- Throws:
IOException
- When an I/O error occurs.
-
endElement
public abstract void endElement(ResponseWriter writer) throws IOException
End the element.- Parameters:
writer
- The response writer.- Throws:
IOException
- When an I/O error occurs.
-
-