|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Basic interface for resolving external TransformerHandler
objects.
An object that implements this interface can be called by the
STX processor if it encounters a request to hand over the processing
to an external TransformerHandler
object. A
TransformerHandlerResolver
must be
registered by using the Joost specific
Processor.setTransformerHandlerResolver(net.sf.joost.TransformerHandlerResolver)
method,
or (using JAXP) by calling
TransformerFactory.setAttribute(java.lang.String, java.lang.Object)
with the string TrAXConstants.KEY_TH_RESOLVER
as its first argument.
The TransformerHandler
object returned
by each of the resolve
methods is required to accept a
SAXResult
as parameter in the
TransformerHandler.setResult(javax.xml.transform.Result)
method.
The other methods TransformerHandler.setSystemId(java.lang.String)
,
TransformerHandler.getSystemId()
,
and TransformerHandler.getTransformer()
won't be called by Joost.
Especially potential parameters for the transformation will be
provided already as the third argument in each of the resolve
methods, so there's no need to implement a
Transformer
dummy solely as means to the
end of enabling Transformer.setParameter(java.lang.String, java.lang.Object)
.
Method Summary | |
boolean |
available(String method)
Determines whether a requested filter is available or not, used by the STX function filter-available . |
TransformerHandler |
resolve(String method,
String href,
String base,
Hashtable params)
Resolves a TransformerHandler object for an external
transformation. |
TransformerHandler |
resolve(String method,
XMLReader reader,
Hashtable params)
Resolves a TransformerHandler object for an external
transformation. |
Method Detail |
public TransformerHandler resolve(String method, String href, String base, Hashtable params) throws SAXException
TransformerHandler
object for an external
transformation. This method will be called if the
filter-src
attribute contains an URL, or if this attribute
is missing at all.
method
- an URI string provided in the filter-method
attribute, identifying the type of the requested filterhref
- the location of the source for the filter provided
in the filter-src
attribute (as pseudo-argument of
the url(...)
notation);
null
if the filter-src
attribute is
missingbase
- the base URI of the transformation sheetparams
- the set of parameters specified using
stx:with-param
elements, all values are
String
s
TransformerHandler
object that transforms a SAX
stream, or null
if the STX processor should try
to resolve the handler itself
SAXException
- if an error occurs during the creation or
initializationpublic TransformerHandler resolve(String method, XMLReader reader, Hashtable params) throws SAXException
TransformerHandler
object for an external
transformation. This method will be called if the
filter-src
attribute contains a buffer specification.
method
- an URI string provided in the filter-method
attribute, identifying the type of the requested filterreader
- an XMLReader
object that provides the
source for the transformation as a stream of SAX events
(the contents of an stx:buffer
). Either
parse
method may be used, the required
parameters systemId
or input
respectively will be ignored by this reader.params
- the set of parameters specified using
stx:with-param
elements, all values are
String
s
TransformerHandler
object that transforms a SAX
stream, or null
if the STX processor should try
to resolve the handler itself
SAXException
- if an error occurs during the creation or
initializationpublic boolean available(String method)
filter-available
.
method
- an URI string identifying the type of the requested filter
true
if this resolver will return a
TransformerHandler
object for this filter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |