public class Transformer extends Filter
TransformRepresentation
to actually transform the XML entities.Modifier and Type | Field and Description |
---|---|
static int |
MODE_REQUEST
Mode that transforms request entities before their handling by the
attached Restlet.
|
static int |
MODE_RESPONSE
Mode that transforms response entities after their handling by the
attached Restlet.
|
Constructor and Description |
---|
Transformer(int mode,
Representation transformSheet)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterHandle(Request request,
Response response) |
protected int |
beforeHandle(Request request,
Response response) |
protected boolean |
canTransform(Representation representation)
Indicates if the filter can transform the given message entity.
|
int |
getMode()
Returns the transformation mode.
|
CharacterSet |
getResultCharacterSet()
Returns the character set of the result representation.
|
java.util.List<Encoding> |
getResultEncodings()
Returns the modifiable list of encodings of the result representation.
|
java.util.List<Language> |
getResultLanguages()
Returns the modifiable list of languages of the result representation.
|
MediaType |
getResultMediaType()
Returns the media type of the result representation.
|
Representation |
getTransformSheet()
Returns the XSLT transform sheet to apply to message entities.
|
void |
setMode(int mode)
Sets the transformation mode.
|
void |
setResultCharacterSet(CharacterSet resultCharacterSet)
Sets the character set of the result representation.
|
void |
setResultEncodings(java.util.List<Encoding> resultEncodings)
Sets the encodings of the result representation.
|
void |
setResultLanguages(java.util.List<Language> resultLanguages)
Sets the languages of the result representation.
|
void |
setResultMediaType(MediaType resultMediaType)
Sets the media type of the result representation.
|
void |
setTransformSheet(Representation transformSheet)
Sets the XSLT transform sheet to apply to message entities.
|
Representation |
transform(Representation source)
Transforms a source XML representation by applying an XSLT transform
sheet to it.
|
doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
public static final int MODE_REQUEST
public static final int MODE_RESPONSE
public Transformer(int mode, Representation transformSheet)
mode
- The transformation mode.transformSheet
- The XSLT transform sheet to apply to message entities.protected void afterHandle(Request request, Response response)
afterHandle
in class Filter
protected int beforeHandle(Request request, Response response)
beforeHandle
in class Filter
protected boolean canTransform(Representation representation)
representation
- The entity representation to test.public int getMode()
public CharacterSet getResultCharacterSet()
public java.util.List<Encoding> getResultEncodings()
public java.util.List<Language> getResultLanguages()
public MediaType getResultMediaType()
public Representation getTransformSheet()
public void setMode(int mode)
mode
- The transformation mode.public void setResultCharacterSet(CharacterSet resultCharacterSet)
resultCharacterSet
- The character set of the result representation.public void setResultEncodings(java.util.List<Encoding> resultEncodings)
resultEncodings
- The encodings of the result representation.public void setResultLanguages(java.util.List<Language> resultLanguages)
resultLanguages
- The languages of the result representation.public void setResultMediaType(MediaType resultMediaType)
resultMediaType
- The media type of the result representation.public void setTransformSheet(Representation transformSheet)
transformSheet
- The XSLT transform sheet to apply to message entities.public Representation transform(Representation source)
source
- The source XML representation.Copyright © 2005-2024 Restlet.