public class XSLTResourceStream extends AbstractResourceStream
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.
Constructor and Description |
---|
XSLTResourceStream(IResourceStream xsltResource,
IResourceStream xmlResource)
Construct.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the resource.
|
String |
getContentType()
Returns always null
|
InputStream |
getInputStream()
Gets the resource stream.
|
protected Map<Object,Object> |
getParameters() |
Time |
lastModifiedTime()
Returns always null
|
Bytes |
length()
Gets the size of this resource
|
getLocale, getStyle, getVariation, setLocale, setStyle, setVariation
public XSLTResourceStream(IResourceStream xsltResource, IResourceStream xmlResource)
xsltResource
- the XSL stylesheet as an IResourceStream
xmlResource
- the input XML document as an IResourceStream
protected Map<Object,Object> getParameters()
Map
of XSLT parameters, appropriate for passing information to the XSL
stylesheetpublic void close() throws IOException
IResourceStream
IOException
IResourceStream.close()
public String getContentType()
getContentType
in interface IResourceStream
getContentType
in class AbstractResourceStream
IResourceStream.getContentType()
public InputStream getInputStream() throws ResourceStreamNotFoundException
IResourceStream
ResourceStreamNotFoundException
IResourceStream.getInputStream()
public Bytes length()
IResourceStream
length
in interface IResourceStream
length
in class AbstractResourceStream
null
if unknownIResourceStream.length()
public Time lastModifiedTime()
lastModifiedTime
in interface IModifiable
lastModifiedTime
in class AbstractResourceStream
Time
or
null
if that information is not availableIModifiable.lastModifiedTime()
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.