org.apache.stanbol.entityhub.jersey.parsers
Class RepresentationReader

java.lang.Object
  extended by org.apache.stanbol.entityhub.jersey.parsers.RepresentationReader
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<java.util.Set<Representation>>

@Provider
public class RepresentationReader
extends java.lang.Object
implements javax.ws.rs.ext.MessageBodyReader<java.util.Set<Representation>>

Provides support for reading Representation form Requests. This implementation supports all RDF supports as well as MediaType.APPLICATION_FORM_URLENCODED - in case the data are sent from an HTML form - and MediaType.MULTIPART_FORM_DATA - mime encoded data. In case of an HTML form the encoding need to be specified by the parameter "encoding" for the entity data the parameters "entity" or "content" can be used.

Author:
Rupert Westenthaler

Field Summary
protected  javax.servlet.ServletContext servletContext
           
static java.util.Set<java.lang.String> supportedMediaTypes
           
 
Constructor Summary
RepresentationReader()
           
 
Method Summary
 boolean isReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 java.util.Set<Representation> parseFromContent(MessageBodyReaderUtils.RequestData content, javax.ws.rs.core.MediaType acceptedMediaType)
           
 java.util.Set<Representation> readFrom(java.lang.Class<java.util.Set<Representation>> type, 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.String> httpHeaders, java.io.InputStream entityStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servletContext

@Context
protected javax.servlet.ServletContext servletContext

supportedMediaTypes

public static final java.util.Set<java.lang.String> supportedMediaTypes
Constructor Detail

RepresentationReader

public RepresentationReader()
Method Detail

isReadable

public boolean isReadable(java.lang.Class<?> type,
                          java.lang.reflect.Type genericType,
                          java.lang.annotation.Annotation[] annotations,
                          javax.ws.rs.core.MediaType mediaType)
Specified by:
isReadable in interface javax.ws.rs.ext.MessageBodyReader<java.util.Set<Representation>>

readFrom

public java.util.Set<Representation> readFrom(java.lang.Class<java.util.Set<Representation>> type,
                                              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.String> httpHeaders,
                                              java.io.InputStream entityStream)
                                       throws java.io.IOException,
                                              javax.ws.rs.WebApplicationException
Specified by:
readFrom in interface javax.ws.rs.ext.MessageBodyReader<java.util.Set<Representation>>
Throws:
java.io.IOException
javax.ws.rs.WebApplicationException

parseFromContent

public java.util.Set<Representation> parseFromContent(MessageBodyReaderUtils.RequestData content,
                                                      javax.ws.rs.core.MediaType acceptedMediaType)


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.