mx4j.adaptor.http
Class XSLTProcessor
mx4j.adaptor.http.XSLTProcessor
- All Implemented Interfaces:
- ProcessorMBean, XSLTProcessorMBean
- public class XSLTProcessor
- implements ProcessorMBean, XSLTProcessorMBean
XSLTPostProcessor pass the document through an XSLT transformation
- Version:
- $Revision: 1.14 $
- Author:
- Carlos Quiroz
Method Summary |
void |
addMimeType(java.lang.String extension,
java.lang.String type)
|
protected javax.xml.transform.Transformer |
createTransformer(java.lang.String path)
|
java.lang.String |
getDefaultPage()
|
java.lang.String |
getFile()
|
protected java.io.InputStream |
getInputStream(java.lang.String path)
|
java.util.Locale |
getLocale()
|
java.lang.String |
getName()
|
java.lang.String |
getPathInJar()
|
boolean |
isUseCache()
|
boolean |
isUseJar()
|
boolean |
isUsePath()
|
java.lang.String |
notFoundElement(java.lang.String path,
HttpOutputStream out,
HttpInputStream in)
Let the processor load internally a not found element. |
java.lang.String |
preProcess(java.lang.String path)
Preprocess a path and return a replacement path. |
protected void |
processHttpException(HttpInputStream in,
HttpOutputStream out,
HttpException e)
|
javax.xml.transform.Source |
resolve(java.lang.String href,
java.lang.String base)
|
void |
setDefaultPage(java.lang.String defaultPage)
|
void |
setFile(java.lang.String file)
|
void |
setLocale(java.util.Locale locale)
|
void |
setLocaleString(java.lang.String locale)
|
void |
setPathInJar(java.lang.String path)
|
void |
setUseCache(boolean useCache)
|
void |
writeError(HttpOutputStream out,
HttpInputStream in,
java.lang.Exception e)
The method will process the result exception and produce output. |
void |
writeResponse(HttpOutputStream out,
HttpInputStream in,
org.w3c.dom.Document document)
The method will process the result string and produce an output. |
XSLTProcessor
public XSLTProcessor()
writeResponse
public void writeResponse(HttpOutputStream out,
HttpInputStream in,
org.w3c.dom.Document document)
throws java.io.IOException
- Description copied from interface:
ProcessorMBean
- The method will process the result string and produce an output. The
implementor is also responsible to set the mime type, response code and
send the headers before answering as follow:
out.setCode(HttpConstants.STATUS_OKAY);
out.setHeader("Content-type", "text/html");
out.sendHeaders();
out.write("some text");
- Specified by:
writeResponse
in interface ProcessorMBean
- Following copied from interface:
mx4j.adaptor.http.ProcessorMBean
- Parameters:
out
- The output streamin
- The input streamdocument
- A document containing the data
createTransformer
protected javax.xml.transform.Transformer createTransformer(java.lang.String path)
processHttpException
protected void processHttpException(HttpInputStream in,
HttpOutputStream out,
HttpException e)
throws java.io.IOException
writeError
public void writeError(HttpOutputStream out,
HttpInputStream in,
java.lang.Exception e)
throws java.io.IOException
- Description copied from interface:
ProcessorMBean
- The method will process the result exception and produce output. The
implementor is also responsible to set the mime type, response code and
send the headers before answering as follow:
out.setCode(HttpConstants.STATUS_OKAY);
out.setHeader("Content-type", "text/html");
out.sendHeaders();
out.write("some text");
- Specified by:
writeError
in interface ProcessorMBean
- Following copied from interface:
mx4j.adaptor.http.ProcessorMBean
- Parameters:
out
- The output streamin
- The input streame
- The exception to be reported
preProcess
public java.lang.String preProcess(java.lang.String path)
- Description copied from interface:
ProcessorMBean
- Preprocess a path and return a replacement path. For instance the / path
could be replaced by the server path
- Specified by:
preProcess
in interface ProcessorMBean
- Following copied from interface:
mx4j.adaptor.http.ProcessorMBean
- Parameters:
path
- The original path- Returns:
- the replacement path. If not modification the path param should
be returned
notFoundElement
public java.lang.String notFoundElement(java.lang.String path,
HttpOutputStream out,
HttpInputStream in)
throws java.io.IOException,
HttpException
- Description copied from interface:
ProcessorMBean
- Let the processor load internally a not found element. This can be used
to load images, stylesheets and so on. If return is not null, the path is
processed
- Specified by:
notFoundElement
in interface ProcessorMBean
- Following copied from interface:
mx4j.adaptor.http.ProcessorMBean
- Parameters:
path
- The request elementout
- The output streamin
- The input stream
getInputStream
protected java.io.InputStream getInputStream(java.lang.String path)
resolve
public javax.xml.transform.Source resolve(java.lang.String href,
java.lang.String base)
setFile
public void setFile(java.lang.String file)
- Specified by:
setFile
in interface XSLTProcessorMBean
getFile
public java.lang.String getFile()
- Specified by:
getFile
in interface XSLTProcessorMBean
getPathInJar
public java.lang.String getPathInJar()
- Specified by:
getPathInJar
in interface XSLTProcessorMBean
setPathInJar
public void setPathInJar(java.lang.String path)
- Specified by:
setPathInJar
in interface XSLTProcessorMBean
getDefaultPage
public java.lang.String getDefaultPage()
- Specified by:
getDefaultPage
in interface XSLTProcessorMBean
setDefaultPage
public void setDefaultPage(java.lang.String defaultPage)
- Specified by:
setDefaultPage
in interface XSLTProcessorMBean
isUseJar
public boolean isUseJar()
- Specified by:
isUseJar
in interface XSLTProcessorMBean
isUsePath
public boolean isUsePath()
- Specified by:
isUsePath
in interface XSLTProcessorMBean
addMimeType
public void addMimeType(java.lang.String extension,
java.lang.String type)
- Specified by:
addMimeType
in interface XSLTProcessorMBean
setUseCache
public void setUseCache(boolean useCache)
- Specified by:
setUseCache
in interface XSLTProcessorMBean
isUseCache
public boolean isUseCache()
- Specified by:
isUseCache
in interface XSLTProcessorMBean
getName
public java.lang.String getName()
- Specified by:
getName
in interface ProcessorMBean
getLocale
public java.util.Locale getLocale()
- Specified by:
getLocale
in interface XSLTProcessorMBean
setLocale
public void setLocale(java.util.Locale locale)
- Specified by:
setLocale
in interface XSLTProcessorMBean
setLocaleString
public void setLocaleString(java.lang.String locale)
- Specified by:
setLocaleString
in interface XSLTProcessorMBean
Copyright © 2001-2002 MX4J Team. All Rights Reserved.