org.openrdf.server.metadata.writers.base
Class MessageWriterBase<FF extends FileFormat,S,T>

java.lang.Object
  extended by org.openrdf.server.metadata.writers.base.MessageWriterBase<FF,S,T>
Type Parameters:
FF - file format
S - reader factory
T - Java type returned
All Implemented Interfaces:
MessageBodyWriter<T>
Direct Known Subclasses:
BooleanMessageWriter, ModelMessageWriter, ResultMessageWriterBase

public abstract class MessageWriterBase<FF extends FileFormat,S,T>
extends Object
implements MessageBodyWriter<T>

Base class for writers that use a FileFormat.

Author:
James Leigh

Constructor Summary
MessageWriterBase(FileFormatServiceRegistry<FF,S> registry, Class<T> type)
           
 
Method Summary
protected  Charset getCharset(FF format, Charset charset)
           
 String getContentType(String mimeType, Class<?> type, ObjectFactory of, Charset charset)
           
protected  S getFactory(String mimeType)
           
protected  FF getFormat(String mimeType)
           
 long getSize(String mimeType, Class<?> type, ObjectFactory of, T result)
           
 boolean isWriteable(String mimeType, Class<?> type, ObjectFactory of)
           
abstract  void writeTo(S factory, T result, OutputStream out, Charset charset, String base)
           
 void writeTo(String mimeType, Class<?> type, ObjectFactory of, T result, String base, Charset charset, OutputStream out, int bufSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageWriterBase

public MessageWriterBase(FileFormatServiceRegistry<FF,S> registry,
                         Class<T> type)
Method Detail

getSize

public long getSize(String mimeType,
                    Class<?> type,
                    ObjectFactory of,
                    T result)
Specified by:
getSize in interface MessageBodyWriter<T>

isWriteable

public boolean isWriteable(String mimeType,
                           Class<?> type,
                           ObjectFactory of)
Specified by:
isWriteable in interface MessageBodyWriter<T>

getContentType

public String getContentType(String mimeType,
                             Class<?> type,
                             ObjectFactory of,
                             Charset charset)
Specified by:
getContentType in interface MessageBodyWriter<T>

writeTo

public void writeTo(String mimeType,
                    Class<?> type,
                    ObjectFactory of,
                    T result,
                    String base,
                    Charset charset,
                    OutputStream out,
                    int bufSize)
             throws IOException,
                    OpenRDFException
Specified by:
writeTo in interface MessageBodyWriter<T>
Throws:
IOException
OpenRDFException

getCharset

protected Charset getCharset(FF format,
                             Charset charset)

writeTo

public abstract void writeTo(S factory,
                             T result,
                             OutputStream out,
                             Charset charset,
                             String base)
                      throws IOException,
                             RDFHandlerException,
                             QueryEvaluationException,
                             TupleQueryResultHandlerException
Throws:
IOException
RDFHandlerException
QueryEvaluationException
TupleQueryResultHandlerException

getFactory

protected S getFactory(String mimeType)

getFormat

protected FF getFormat(String mimeType)


Copyright © 2004-2009 James Leigh Services Inc.. All Rights Reserved.