java.lang.Object
org.apache.wicket.util.resource.AbstractResourceStream
org.apache.wicket.util.resource.XSLTResourceStream
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,IClusterable,IResourceStream,IModifiable
IResourceStream that applies XSLT on an input IResourceStream. The XSL stylesheet
itself is also an IResourceStream. Override getParameters() to pass parameters
to the XSL stylesheet.
NOTE: this is an experimental feature which does not implement any kind of caching, use with
care, running an XSL transformation for every request is very expensive! Please have a look at
ZipResourceStream for an in-depth explanation of what needs to be done with respect to
caching.
- Author:
- Jean-Baptiste Quenot
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionXSLTResourceStream(IResourceStream xsltResource, IResourceStream xmlResource) Construct.XSLTResourceStream(IResourceStream xsltResource, IResourceStream xmlResource, TransformerFactory transformerFactory) Construct. -
Method Summary
Methods inherited from class org.apache.wicket.util.resource.AbstractResourceStream
getLocale, getStyle, getVariation, setLocale, setStyle, setVariation
-
Constructor Details
-
XSLTResourceStream
Construct.- Parameters:
xsltResource- the XSL stylesheet as anIResourceStreamxmlResource- the input XML document as anIResourceStream
-
XSLTResourceStream
public XSLTResourceStream(IResourceStream xsltResource, IResourceStream xmlResource, TransformerFactory transformerFactory) Construct.- Parameters:
xsltResource- the XSL stylesheet as anIResourceStreamxmlResource- the input XML document as anIResourceStreamtransformerFactory- the transformer factory used to transform the xmlResource
-
-
Method Details
-
getParameters
- Returns:
- a
Mapof XSLT parameters, appropriate for passing information to the XSL stylesheet
-
close
Description copied from interface:IResourceStreamCloses the resource. Normally, this includes closing any underlying input stream returned by getInputStream().- Throws:
IOException- See Also:
-
getContentType
Returns always null- Specified by:
getContentTypein interfaceIResourceStream- Overrides:
getContentTypein classAbstractResourceStream- Returns:
- The mime type of this resource, such as "image/jpeg" or "text/html". Return null to let ResourceStreamRequestHandler handle the Content-Type automatically
- See Also:
-
getInputStream
Description copied from interface:IResourceStreamGets the resource stream. You should not directly close this stream. Instead call the close() method on IResourceStream.- Returns:
- Returns the inputStream.
- Throws:
ResourceStreamNotFoundException- See Also:
-
length
Description copied from interface:IResourceStreamGets the size of this resource- Specified by:
lengthin interfaceIResourceStream- Overrides:
lengthin classAbstractResourceStream- Returns:
- The size of this resource in the number of bytes, or
nullif unknown - See Also:
-
lastModifiedTime
Returns always null- Specified by:
lastModifiedTimein interfaceIModifiable- Overrides:
lastModifiedTimein classAbstractResourceStream- Returns:
- the last modification
Timeornullif that information is not available - See Also:
-