|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.stanbol.entityhub.jersey.utils.JerseyUtils
public final class JerseyUtils
Utility methods used by several of the RESTful service endpoints of the Entityhub.
| Field Summary | |
|---|---|
static java.util.Set<java.lang.String> |
ENTITY_SUPPORTED_MEDIA_TYPES
Unmodifiable Set with the Media Types supported for Entity |
static java.util.Set<java.lang.String> |
QUERY_RESULT_SUPPORTED_MEDIA_TYPES
Unmodifiable Set with the Media Types supported for QueryResultList |
static java.util.Set<java.lang.String> |
REPRESENTATION_SUPPORTED_MEDIA_TYPES
Unmodifiable Set with the Media Types supported for Representation |
| Method Summary | |
|---|---|
static FieldQuery |
createFieldQueryForFindRequest(java.lang.String name,
java.lang.String field,
java.lang.String language,
java.lang.Integer limit,
java.lang.Integer offset,
java.lang.String ldpath)
Creates an FieldQuery for parameters parsed by the /find requests
supported by the /symbol, /sites and {siteId} RESTful endpoints. |
static java.util.Map<java.lang.String,java.lang.String> |
parseForm(java.io.InputStream entityStream,
java.lang.String charset)
This Method is intended to parse form data from MediaType.APPLICATION_FORM_URLENCODED requests. |
static boolean |
testType(java.lang.Class<?> required,
java.lang.reflect.Type genericType)
Tests if a generic type (may be <?>, <? extends {required}> or <? super {required}>) is compatible with the required one. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Set<java.lang.String> REPRESENTATION_SUPPORTED_MEDIA_TYPES
Representation
public static final java.util.Set<java.lang.String> ENTITY_SUPPORTED_MEDIA_TYPES
Entity
public static final java.util.Set<java.lang.String> QUERY_RESULT_SUPPORTED_MEDIA_TYPES
QueryResultList
| Method Detail |
|---|
public static FieldQuery createFieldQueryForFindRequest(java.lang.String name,
java.lang.String field,
java.lang.String language,
java.lang.Integer limit,
java.lang.Integer offset,
java.lang.String ldpath)
throws javax.ws.rs.WebApplicationException,
java.lang.IllegalArgumentException
FieldQuery for parameters parsed by the /find requests
supported by the /symbol, /sites and {siteId} RESTful endpoints.
TODO: This has to be refactored to use "EntityQuery" as soon as Multiple
query types are implemented for the Entityhub.
name - the name pattern to search entities for (required)field - the field used to search for entities (required)language - the language of the parsed name pattern (optional)limit - the maximum number of result (optional)offset - the offset of the first result (optional)
FieldQuery representing the parsed parameter
javax.ws.rs.WebApplicationException - in case the parsed name pattern is invalid.
The validation of this required parameter provided by the Request is done
by this method.
java.lang.IllegalArgumentException - in case the parsed field is invalid. Callers
of this method need to ensure that this parameter is set to an valid value.
public static boolean testType(java.lang.Class<?> required,
java.lang.reflect.Type genericType)
required - the required class the generic type MUST BE compatible withgenericType - the required class
public static java.util.Map<java.lang.String,java.lang.String> parseForm(java.io.InputStream entityStream,
java.lang.String charset)
throws java.io.IOException
MediaType.APPLICATION_FORM_URLENCODED requests. This functionality
us usually needed when writing a MessageBodyReader to get the
data from the "InputStream entityStream" parameter of the
MessageBodyReader.readFrom(Class, Type, java.lang.annotation.Annotation[], MediaType, javax.ws.rs.core.MultivaluedMap, InputStream)
method.
entityStream - the stream with the form datacharset - The charset used for the request (if null or
empty UTF-8 is used as default.
java.io.IOException - on any exception while reading the data form the stream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||