|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.seam.rest.templating.TemplatingMessageBodyWriter
@Provider @ApplicationScoped public class TemplatingMessageBodyWriter
TemplatingMessageBodyWriter is enabled for every JAX-RS method annotated with @ResponseTemplate annotation and
delegates response production to the TemplatingProvider.
| Constructor Summary | |
|---|---|
TemplatingMessageBodyWriter()
|
|
| Method Summary | |
|---|---|
org.jboss.seam.rest.templating.TemplatingProvider |
getProvider()
|
long |
getSize(Object t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
|
void |
init(javax.enterprise.inject.Instance<org.jboss.seam.rest.templating.TemplatingProvider> providerInstance,
javax.enterprise.inject.Instance<org.jboss.seam.rest.SeamRestConfiguration> configuration)
Initializes TemplatingMessageBodyWriter. |
void |
init(javax.servlet.ServletContext context)
Initializes the TemplatingProvider if available. |
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
Returns true if and only if the templating extension is enabled and the method contains the @ResponseTemplate annotation. |
void |
writeTo(Object t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
OutputStream entityStream)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TemplatingMessageBodyWriter()
| Method Detail |
|---|
@Inject
public void init(javax.enterprise.inject.Instance<org.jboss.seam.rest.templating.TemplatingProvider> providerInstance,
javax.enterprise.inject.Instance<org.jboss.seam.rest.SeamRestConfiguration> configuration)
TemplatingProvider is selected.
javax.enterprise.inject.UnsatisfiedResolutionException - if the preferred TemplatingProvider is selected but is not available
for injection.
javax.enterprise.inject.AmbiguousResolutionException - if there are multiple TemplatingProviders available.
public void init(@Observes@RestResource
javax.servlet.ServletContext context)
TemplatingProvider if available.
public boolean isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
@ResponseTemplate annotation.
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<Object>
public long getSize(Object t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
getSize in interface javax.ws.rs.ext.MessageBodyWriter<Object>
public void writeTo(Object t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
OutputStream entityStream)
throws IOException,
javax.ws.rs.WebApplicationException
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<Object>IOException
javax.ws.rs.WebApplicationExceptionpublic org.jboss.seam.rest.templating.TemplatingProvider getProvider()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||