Apache CXF API

org.apache.cxf.jaxrs.provider.jsonp
Class JsonpPreStreamInterceptor

java.lang.Object
  extended by org.apache.cxf.phase.AbstractPhaseInterceptor<Message>
      extended by org.apache.cxf.jaxrs.provider.jsonp.AbstractJsonpOutInterceptor
          extended by org.apache.cxf.jaxrs.provider.jsonp.JsonpPreStreamInterceptor
All Implemented Interfaces:
javax.ws.rs.ext.WriterInterceptor, Interceptor<Message>, PhaseInterceptor<Message>

public class JsonpPreStreamInterceptor
extends AbstractJsonpOutInterceptor
implements javax.ws.rs.ext.WriterInterceptor

Appends the jsonp callback to json responses when the '_jsonp' parameter has been set in the querystring.


Constructor Summary
JsonpPreStreamInterceptor()
           
 
Method Summary
 void aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext context)
           
 String getMediaType()
           
 String getPaddingEnd()
           
 void handleMessage(Message message)
          Intercepts a message.
protected  void setContentType(Message message)
           
 void setMediaType(String mediaType)
           
 void setPaddingEnd(String paddingEnd)
           
 
Methods inherited from class org.apache.cxf.jaxrs.provider.jsonp.AbstractJsonpOutInterceptor
getCallbackValue, writeValue
 
Methods inherited from class org.apache.cxf.phase.AbstractPhaseInterceptor
addAfter, addAfter, addBefore, addBefore, getAdditionalInterceptors, getAfter, getBefore, getId, getPhase, handleFault, isGET, isRequestor, setAfter, setBefore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonpPreStreamInterceptor

public JsonpPreStreamInterceptor()
Method Detail

handleMessage

public void handleMessage(Message message)
                   throws Fault
Description copied from interface: Interceptor
Intercepts a message. Interceptors should NOT invoke handleMessage or handleFault on the next interceptor - the interceptor chain will take care of this.

Specified by:
handleMessage in interface Interceptor<Message>
Throws:
Fault

setContentType

protected void setContentType(Message message)

setMediaType

public void setMediaType(String mediaType)

getMediaType

public String getMediaType()

setPaddingEnd

public void setPaddingEnd(String paddingEnd)

getPaddingEnd

public String getPaddingEnd()

aroundWriteTo

public void aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext context)
                   throws IOException,
                          javax.ws.rs.WebApplicationException
Specified by:
aroundWriteTo in interface javax.ws.rs.ext.WriterInterceptor
Throws:
IOException
javax.ws.rs.WebApplicationException

Apache CXF API

Apache CXF