at.ac.tuwien.infosys.sm4all.copal.rest.provider
Class XMLWriter<T>

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.rest.provider.XMLWriter<T>
Type Parameters:
T - the type of written value.
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<T>
Direct Known Subclasses:
XMLContextEventTypesWriter, XMLContextListenersWriter, XMLContextProcessorsWriter, XMLContextPublishersWriter, XMLProcessedEventQueriesWriter

@Provider
public abstract class XMLWriter<T>
extends java.lang.Object
implements javax.ws.rs.ext.MessageBodyWriter<T>

An abstract MessageBodyWriter that writes an instance of a Class into an application/xml OutputStream.

Author:
sanjin

Constructor Summary
protected XMLWriter(java.lang.Class<T> type)
          Creates instance of MessageBodyWriter that writes an instance of specified Class into an application/xml OutputStream.
 
Method Summary
 long getSize(T value, java.lang.Class<?> klass, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isWriteable(java.lang.Class<?> klass, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
protected abstract  void marshal(T value, org.w3c.dom.Element element)
          Marshal specified value into specified Element.
 void writeTo(T value, java.lang.Class<?> klass, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders, java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLWriter

protected XMLWriter(java.lang.Class<T> type)
Creates instance of MessageBodyWriter that writes an instance of specified Class into an application/xml OutputStream.

Parameters:
type - the Class of instances that are written.
Method Detail

getSize

public long getSize(T value,
                    java.lang.Class<?> klass,
                    java.lang.reflect.Type genericType,
                    java.lang.annotation.Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType)
Specified by:
getSize in interface javax.ws.rs.ext.MessageBodyWriter<T>

isWriteable

public boolean isWriteable(java.lang.Class<?> klass,
                           java.lang.reflect.Type genericType,
                           java.lang.annotation.Annotation[] annotations,
                           javax.ws.rs.core.MediaType mediaType)
Specified by:
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<T>

writeTo

public void writeTo(T value,
                    java.lang.Class<?> klass,
                    java.lang.reflect.Type genericType,
                    java.lang.annotation.Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders,
                    java.io.OutputStream out)
             throws javax.ws.rs.WebApplicationException
Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<T>
Throws:
javax.ws.rs.WebApplicationException

marshal

protected abstract void marshal(T value,
                                org.w3c.dom.Element element)
Marshal specified value into specified Element.

Parameters:
value - the value to be marshaled.
element - the Element used for marshalling.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.