|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.Uniform
org.restlet.Restlet
org.restlet.Filter
org.restlet.Transformer
public class Transformer
Filter that can transform XML representations by applying an XSLT transform
sheet. It uses the TransformRepresentation
to
actually transform the XML entities.
Concurrency note: instances of this class or its subclasses can be invoked by
several threads at the same time and therefore must be thread-safe. You
should be especially careful when storing state in member variables.
Field Summary | |
---|---|
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. |
Fields inherited from class org.restlet.Filter |
---|
CONTINUE, SKIP, STOP |
Constructor Summary | |
---|---|
Transformer(int mode,
Representation transformSheet)
Constructor. |
Method Summary | |
---|---|
protected void |
afterHandle(Request request,
Response response)
Allows filtering after processing by the next Restlet. |
protected int |
beforeHandle(Request request,
Response response)
Allows filtering before processing by the next Restlet. |
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. |
Methods inherited from class org.restlet.Filter |
---|
doHandle, getNext, handle, hasNext, setNext, setNext |
Methods inherited from class org.restlet.Restlet |
---|
getApplication, getContext, getLogger, init, isStarted, isStopped, setContext, start, stop |
Methods inherited from class org.restlet.Uniform |
---|
delete, delete, get, get, handle, head, head, options, options, post, post, put, put |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MODE_REQUEST
public static final int MODE_RESPONSE
Constructor Detail |
---|
public Transformer(int mode, Representation transformSheet)
mode
- The transformation mode.transformSheet
- The XSLT transform sheet to apply to message entities.Method Detail |
---|
protected void afterHandle(Request request, Response response)
Filter
afterHandle
in class Filter
request
- The request to handle.response
- The response to update.protected int beforeHandle(Request request, Response response)
Filter
Filter.CONTINUE
by default.
beforeHandle
in class Filter
request
- The request to handle.response
- The response to update.
Filter.CONTINUE
or
Filter.SKIP
or Filter.STOP
.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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |