org.weborganic.berlioz.servlet
Class XSLTransformResult

java.lang.Object
  extended by org.weborganic.berlioz.servlet.XSLTransformResult
All Implemented Interfaces:
BerliozOutput

public final class XSLTransformResult
extends Object
implements BerliozOutput

Holds the results of a transformation process.

This class holds information about a process such as its content, processing time (in ms), status and exception.

Since:
Berlioz 0.7
Version:
Berlioz 0.9.14 - 22 January 2013
Author:
Christophe Lauret

Nested Class Summary
static class XSLTransformResult.Status
          The status of a process result.
 
Constructor Summary
XSLTransformResult(CharSequence content, Exception ex, Templates templates)
          Creates an unsuccessful process result.
XSLTransformResult(CharSequence content, long time, Templates templates)
          Creates a successful transformation result.
 
Method Summary
 CharSequence content()
           
 String getEncoding()
          The character encoding for the content.
 String getErrorMessage()
           
 Exception getException()
           
 String getMediaType()
          Returns the media type for this output.
 XSLTransformResult.Status status()
          Returns the status of the process result.
 long time()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSLTransformResult

public XSLTransformResult(CharSequence content,
                          long time,
                          Templates templates)
Creates a successful transformation result.

Parameters:
content - The content.
time - The processing nano seconds.
templates - The templates used for the transformation.

XSLTransformResult

public XSLTransformResult(CharSequence content,
                          Exception ex,
                          Templates templates)
Creates an unsuccessful process result.

Parameters:
content - The content.
ex - An exception.
templates - The templates used for the transformation.
Method Detail

content

public CharSequence content()
Specified by:
content in interface BerliozOutput
Returns:
the transformed content.

time

public long time()
Returns:
The processing time in nano seconds.

status

public XSLTransformResult.Status status()
Returns the status of the process result.

Returns:
the status of the process result.

getErrorMessage

public String getErrorMessage()
Returns:
An error message or null if none.

getException

public Exception getException()
Returns:
An error message or null if none.

getMediaType

public String getMediaType()
Description copied from interface: BerliozOutput
Returns the media type for this output.

Specified by:
getMediaType in interface BerliozOutput
Returns:
The content type (MIME) as defined in the XSLT templates.

getEncoding

public String getEncoding()
Description copied from interface: BerliozOutput
The character encoding for the content.

Specified by:
getEncoding in interface BerliozOutput
Returns:
The character encoding as defined in the XSLT templates.
See Also:
IANA Character Sets