|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.sswap.http.representation.rdf.ModelWriter
@Provider public class ModelWriter
A writer for a SSWAPModel. This class is capable of producing the models as RDF/XML (commented) or Turtle.
Field Summary | |
---|---|
private static org.apache.log4j.Logger |
LOGGER
The logger for the model writer. |
Constructor Summary | |
---|---|
ModelWriter()
|
Method Summary | |
---|---|
long |
getSize(info.sswap.api.model.SSWAPModel model,
java.lang.Class<?> clazz,
java.lang.reflect.Type type,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
Gets the estimated size of the output. |
private boolean |
isMediaTypeAcceptable(javax.ws.rs.core.MediaType mediaType)
Checks whether mediaType is one of the acceptable MIME types (currently only RDF formats are acceptable). |
boolean |
isWriteable(java.lang.Class<?> clazz,
java.lang.reflect.Type type,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
Checks whether this writer is capable of producing the output for the given object and the requested MIME type. |
void |
writeTo(info.sswap.api.model.SSWAPModel model,
java.lang.Class<?> clazz,
java.lang.reflect.Type type,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> stringObjectMultiValuedMap,
java.io.OutputStream outputStream)
Produces the output for the specified SSWAPModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.Logger LOGGER
Constructor Detail |
---|
public ModelWriter()
Method Detail |
---|
public long getSize(info.sswap.api.model.SSWAPModel model, java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
getSize
in interface javax.ws.rs.ext.MessageBodyWriter<info.sswap.api.model.SSWAPModel>
model
- the sswap model to be writtenclazz
- the class of the object to be written (the actual implementation of SSWAPModel)type
- the type of the passed object (in this case java.lang.Class)annotations
- the array of annotations of the classmediaType
- the requested MIME type in which the output should be producedprivate boolean isMediaTypeAcceptable(javax.ws.rs.core.MediaType mediaType)
mediaType
- MIME type to be checked
public boolean isWriteable(java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isWriteable
in interface javax.ws.rs.ext.MessageBodyWriter<info.sswap.api.model.SSWAPModel>
clazz
- the class of the object to be written.type
- the type of the passed object (Array, Class, etc)annotations
- the array of annotationsmediaType
- the requested MIME type in which the output should be produced
public void writeTo(info.sswap.api.model.SSWAPModel model, java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> stringObjectMultiValuedMap, java.io.OutputStream outputStream) throws java.io.IOException, javax.ws.rs.WebApplicationException
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<info.sswap.api.model.SSWAPModel>
model
- the sswap model to be writtenclazz
- the class of the object to be written (the actual implementation of SSWAPModel)type
- the type of the passed object (in this case java.lang.Class)annotations
- the array of annotations of the classmediaType
- the requested MIME type in which the output should be producedstringObjectMultiValuedMap
- this parameter is not used by this implementationoutputStream
- the stream to which the output should be written
javax.ws.rs.WebApplicationException
- if the specified object cannot be written by this writer or the media type is not supported by this
writer
java.io.IOException
- if an I/O error should occur while writing the output to the stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |