org.jboss.seam.rest.templating.velocity
Class VelocityProvider

java.lang.Object
  extended by org.jboss.seam.rest.templating.velocity.VelocityProvider
All Implemented Interfaces:
TemplatingProvider

@ApplicationScoped
public class VelocityProvider
extends Object
implements TemplatingProvider

Renders response using Apache Velocity.

Author:
Jozef Hartinger

Constructor Summary
VelocityProvider()
           
 
Method Summary
 void init(ServletContext servletContext)
          Initialization callback.
 String toString()
           
 void writeTo(Object o, ResponseTemplate annotation, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,Object> httpHeaders, OutputStream os)
          Produces the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VelocityProvider

public VelocityProvider()
Method Detail

init

public void init(ServletContext servletContext)
Description copied from interface: TemplatingProvider
Initialization callback. The method is guaranteed to be invoked before calling the writeTo() method.

Specified by:
init in interface TemplatingProvider

writeTo

public void writeTo(Object o,
                    ResponseTemplate annotation,
                    Annotation[] annotations,
                    MediaType mediaType,
                    MultivaluedMap<String,Object> httpHeaders,
                    OutputStream os)
             throws IOException
Description copied from interface: TemplatingProvider
Produces the response.

Specified by:
writeTo in interface TemplatingProvider
Parameters:
o - object returned by the JAX-RS method
annotation - @ResponseTemplate annotation instance
annotations - annotations available on the JAX-RS method
mediaType - requested media type
httpHeaders - request HTTP headers
os - HTTP response output stream
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 Seam Framework. All Rights Reserved.