public final class JAXRSUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static javax.ws.rs.core.MediaType |
ALL_TYPES |
static String |
DEFAULT_PROVIDERS_FOR_SIMPLE_TYPES |
static String |
DOC_LOCATION |
static String |
EXCEPTION_FROM_MAPPER |
static String |
IGNORE_MESSAGE_WRITERS |
static String |
MEDIA_TYPE_Q_PARAM |
static String |
MEDIA_TYPE_QS_PARAM |
static String |
PARTIAL_HIERARCHICAL_MEDIA_SUBTYPE_CHECK |
static String |
ROOT_INSTANCE |
static String |
ROOT_PROVIDER |
static String |
ROOT_RESOURCE_CLASS |
| Modifier and Type | Method and Description |
|---|---|
static int |
compareMediaTypes(javax.ws.rs.core.MediaType mt1,
javax.ws.rs.core.MediaType mt2) |
static int |
compareMediaTypes(javax.ws.rs.core.MediaType mt1,
javax.ws.rs.core.MediaType mt2,
String qs) |
static int |
compareMediaTypesQualityFactors(javax.ws.rs.core.MediaType mt1,
javax.ws.rs.core.MediaType mt2) |
static int |
compareMediaTypesQualityFactors(javax.ws.rs.core.MediaType mt1,
javax.ws.rs.core.MediaType mt2,
String qs) |
static int |
compareSortedAcceptMediaTypes(List<javax.ws.rs.core.MediaType> mts1,
List<javax.ws.rs.core.MediaType> mts2,
List<javax.ws.rs.core.MediaType> acceptTypes) |
static int |
compareSortedConsumesMediaTypes(List<javax.ws.rs.core.MediaType> mts1,
List<javax.ws.rs.core.MediaType> mts2,
javax.ws.rs.core.MediaType ct) |
static int |
compareSortedMediaTypes(List<javax.ws.rs.core.MediaType> mts1,
List<javax.ws.rs.core.MediaType> mts2,
String qs) |
static <T extends Throwable> |
convertFaultToResponse(T ex,
Message currentMessage) |
static QName |
convertStringToQName(String name) |
static javax.ws.rs.core.Response |
copyResponseIfNeeded(javax.ws.rs.core.Response response) |
static Object |
createBeanParamValue(Message m,
Class<?> clazz,
OperationResourceInfo ori) |
static javax.ws.rs.ext.ContextResolver<?> |
createContextResolver(Type genericType,
Message m) |
static <T> T |
createContextValue(Message m,
Type genericType,
Class<T> clazz) |
static Object |
createHttpParameterValue(Parameter parameter,
Class<?> parameterClass,
Type genericParam,
Annotation[] paramAnns,
Message message,
javax.ws.rs.core.MultivaluedMap<String,String> values,
OperationResourceInfo ori) |
static Object |
createResourceValue(Message m,
Type genericType,
Class<?> clazz) |
static javax.ws.rs.core.Response |
createResponse(ClassResourceInfo cri,
Message msg,
String responseMessage,
int status,
boolean addAllow) |
static <T> T |
createServletResourceValue(Message m,
Class<T> clazz) |
static OperationResourceInfo |
findTargetMethod(ClassResourceInfo resource,
Message message,
String httpMethod,
javax.ws.rs.core.MultivaluedMap<String,String> values,
String requestContentType,
List<javax.ws.rs.core.MediaType> acceptContentTypes,
boolean logNow) |
static javax.ws.rs.core.Response.ResponseBuilder |
fromResponse(javax.ws.rs.core.Response response) |
static QName |
getClassQName(Class<?> type) |
static List<javax.ws.rs.core.MediaType> |
getConsumeTypes(javax.ws.rs.Consumes cm) |
static javax.ws.rs.core.MultivaluedMap<String,String> |
getMatrixParams(String path,
boolean decode) |
static float |
getMediaTypeQualityFactor(String q) |
static List<javax.ws.rs.core.MediaType> |
getMediaTypes(String[] values) |
static List<javax.ws.rs.core.PathSegment> |
getPathSegments(String thePath,
boolean decode) |
static List<javax.ws.rs.core.PathSegment> |
getPathSegments(String thePath,
boolean decode,
boolean ignoreLastSlash) |
static List<javax.ws.rs.core.MediaType> |
getProduceTypes(javax.ws.rs.Produces pm) |
static List<javax.ws.rs.core.MediaType> |
getProviderConsumeTypes(javax.ws.rs.ext.MessageBodyReader<?> provider) |
static List<javax.ws.rs.core.MediaType> |
getProviderProduceTypes(javax.ws.rs.ext.MessageBodyWriter<?> provider) |
static void |
getStructuredParams(javax.ws.rs.core.MultivaluedMap<String,String> queries,
String query,
String sep,
boolean decode,
boolean decodePlus) |
static javax.ws.rs.core.MultivaluedMap<String,String> |
getStructuredParams(String query,
String sep,
boolean decode,
boolean decodePlus)
Retrieve map of query parameters from the passed in message
|
static Class<?> |
getWebApplicationExceptionClass(javax.ws.rs.core.Response exResponse,
Class<?> defaultExceptionType) |
static boolean |
headMethodPossible(String expectedMethod,
String httpMethod) |
static void |
injectParameters(OperationResourceInfo ori,
BeanResourceInfo bri,
Object requestObject,
Message message) |
static void |
injectParameters(OperationResourceInfo ori,
Object requestObject,
Message message) |
static List<javax.ws.rs.core.MediaType> |
intersectMimeTypes(List<javax.ws.rs.core.MediaType> requiredMediaTypes,
List<javax.ws.rs.core.MediaType> userMediaTypes,
boolean addRequiredParamsIfPossible)
intersect two mime types
|
static List<javax.ws.rs.core.MediaType> |
intersectMimeTypes(List<javax.ws.rs.core.MediaType> requiredMediaTypes,
List<javax.ws.rs.core.MediaType> userMediaTypes,
boolean addRequiredParamsIfPossible,
boolean addDistanceParameter) |
static List<javax.ws.rs.core.MediaType> |
intersectMimeTypes(List<javax.ws.rs.core.MediaType> mimeTypesA,
javax.ws.rs.core.MediaType mimeTypeB) |
static List<javax.ws.rs.core.MediaType> |
intersectMimeTypes(String mimeTypesA,
String mimeTypesB) |
static boolean |
matchConsumeTypes(javax.ws.rs.core.MediaType requestContentType,
OperationResourceInfo ori) |
static boolean |
matchMimeTypes(javax.ws.rs.core.MediaType requestContentType,
javax.ws.rs.core.MediaType acceptContentType,
OperationResourceInfo ori) |
static boolean |
matchProduceTypes(javax.ws.rs.core.MediaType acceptContentType,
OperationResourceInfo ori) |
static String |
mediaTypeToString(javax.ws.rs.core.MediaType mt,
String... ignoreParams) |
static boolean |
noResourceMethodForOptions(javax.ws.rs.core.Response exResponse,
String httpMethod) |
static List<javax.ws.rs.core.MediaType> |
parseMediaTypes(String types) |
static List<Object> |
processParameters(OperationResourceInfo ori,
javax.ws.rs.core.MultivaluedMap<String,String> values,
Message message) |
static boolean |
propogateException(Message m) |
static Object |
readFromMessageBodyReader(List<javax.ws.rs.ext.ReaderInterceptor> readers,
Class<?> targetTypeClass,
Type parameterType,
Annotation[] parameterAnnotations,
InputStream is,
javax.ws.rs.core.MediaType mediaType,
Message m) |
static boolean |
runContainerRequestFilters(ProviderFactory pf,
Message m,
boolean preMatch,
List<String> names) |
static void |
runContainerResponseFilters(ProviderFactory pf,
javax.ws.rs.core.Response r,
Message m,
OperationResourceInfo ori,
Method invoked) |
static ClassResourceInfo |
selectResourceClass(List<ClassResourceInfo> resources,
String path,
javax.ws.rs.core.MultivaluedMap<String,String> values,
Message message) |
static void |
setMessageContentType(Message message,
javax.ws.rs.core.Response response) |
static List<javax.ws.rs.core.MediaType> |
sortMediaTypes(List<javax.ws.rs.core.MediaType> types,
String qs) |
static List<javax.ws.rs.core.MediaType> |
sortMediaTypes(String mediaTypes,
String qs) |
static javax.ws.rs.core.MediaType |
toMediaType(String value) |
static javax.ws.rs.core.Response |
toResponse(int status) |
static javax.ws.rs.core.Response |
toResponse(javax.ws.rs.core.Response.Status status) |
static javax.ws.rs.core.Response.ResponseBuilder |
toResponseBuilder(int status) |
static javax.ws.rs.core.Response.ResponseBuilder |
toResponseBuilder(javax.ws.rs.core.Response.Status status) |
static void |
writeMessageBody(List<javax.ws.rs.ext.WriterInterceptor> writers,
Object entity,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
Message message) |
public static final javax.ws.rs.core.MediaType ALL_TYPES
public static final String ROOT_RESOURCE_CLASS
public static final String IGNORE_MESSAGE_WRITERS
public static final String ROOT_INSTANCE
public static final String ROOT_PROVIDER
public static final String EXCEPTION_FROM_MAPPER
public static final String PARTIAL_HIERARCHICAL_MEDIA_SUBTYPE_CHECK
public static final String DOC_LOCATION
public static final String DEFAULT_PROVIDERS_FOR_SIMPLE_TYPES
public static final String MEDIA_TYPE_Q_PARAM
public static final String MEDIA_TYPE_QS_PARAM
public static List<javax.ws.rs.core.PathSegment> getPathSegments(String thePath, boolean decode)
public static List<javax.ws.rs.core.PathSegment> getPathSegments(String thePath, boolean decode, boolean ignoreLastSlash)
public static List<javax.ws.rs.core.MediaType> getProviderConsumeTypes(javax.ws.rs.ext.MessageBodyReader<?> provider)
public static List<javax.ws.rs.core.MediaType> getProviderProduceTypes(javax.ws.rs.ext.MessageBodyWriter<?> provider)
public static void injectParameters(OperationResourceInfo ori, Object requestObject, Message message)
public static void injectParameters(OperationResourceInfo ori, BeanResourceInfo bri, Object requestObject, Message message)
public static ClassResourceInfo selectResourceClass(List<ClassResourceInfo> resources, String path, javax.ws.rs.core.MultivaluedMap<String,String> values, Message message)
public static OperationResourceInfo findTargetMethod(ClassResourceInfo resource, Message message, String httpMethod, javax.ws.rs.core.MultivaluedMap<String,String> values, String requestContentType, List<javax.ws.rs.core.MediaType> acceptContentTypes, boolean logNow)
public static boolean noResourceMethodForOptions(javax.ws.rs.core.Response exResponse,
String httpMethod)
public static javax.ws.rs.core.Response createResponse(ClassResourceInfo cri, Message msg, String responseMessage, int status, boolean addAllow)
public static boolean headMethodPossible(String expectedMethod, String httpMethod)
public static List<javax.ws.rs.core.MediaType> getConsumeTypes(javax.ws.rs.Consumes cm)
public static List<javax.ws.rs.core.MediaType> getProduceTypes(javax.ws.rs.Produces pm)
public static int compareSortedConsumesMediaTypes(List<javax.ws.rs.core.MediaType> mts1, List<javax.ws.rs.core.MediaType> mts2, javax.ws.rs.core.MediaType ct)
public static int compareSortedAcceptMediaTypes(List<javax.ws.rs.core.MediaType> mts1, List<javax.ws.rs.core.MediaType> mts2, List<javax.ws.rs.core.MediaType> acceptTypes)
public static int compareSortedMediaTypes(List<javax.ws.rs.core.MediaType> mts1, List<javax.ws.rs.core.MediaType> mts2, String qs)
public static int compareMediaTypes(javax.ws.rs.core.MediaType mt1,
javax.ws.rs.core.MediaType mt2)
public static int compareMediaTypes(javax.ws.rs.core.MediaType mt1,
javax.ws.rs.core.MediaType mt2,
String qs)
public static int compareMediaTypesQualityFactors(javax.ws.rs.core.MediaType mt1,
javax.ws.rs.core.MediaType mt2)
public static int compareMediaTypesQualityFactors(javax.ws.rs.core.MediaType mt1,
javax.ws.rs.core.MediaType mt2,
String qs)
public static float getMediaTypeQualityFactor(String q)
public static List<Object> processParameters(OperationResourceInfo ori, javax.ws.rs.core.MultivaluedMap<String,String> values, Message message) throws IOException, javax.ws.rs.WebApplicationException
IOExceptionjavax.ws.rs.WebApplicationExceptionpublic static Object createHttpParameterValue(Parameter parameter, Class<?> parameterClass, Type genericParam, Annotation[] paramAnns, Message message, javax.ws.rs.core.MultivaluedMap<String,String> values, OperationResourceInfo ori)
public static javax.ws.rs.core.MultivaluedMap<String,String> getMatrixParams(String path, boolean decode)
public static Object createBeanParamValue(Message m, Class<?> clazz, OperationResourceInfo ori)
public static <T> T createContextValue(Message m, Type genericType, Class<T> clazz)
public static javax.ws.rs.ext.ContextResolver<?> createContextResolver(Type genericType, Message m)
public static Object createResourceValue(Message m, Type genericType, Class<?> clazz)
public static <T> T createServletResourceValue(Message m, Class<T> clazz)
public static javax.ws.rs.core.MultivaluedMap<String,String> getStructuredParams(String query, String sep, boolean decode, boolean decodePlus)
message - public static void getStructuredParams(javax.ws.rs.core.MultivaluedMap<String,String> queries, String query, String sep, boolean decode, boolean decodePlus)
public static Object readFromMessageBodyReader(List<javax.ws.rs.ext.ReaderInterceptor> readers, Class<?> targetTypeClass, Type parameterType, Annotation[] parameterAnnotations, InputStream is, javax.ws.rs.core.MediaType mediaType, Message m) throws IOException, javax.ws.rs.WebApplicationException
IOExceptionjavax.ws.rs.WebApplicationExceptionpublic static void writeMessageBody(List<javax.ws.rs.ext.WriterInterceptor> writers, Object entity, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, Message message) throws javax.ws.rs.WebApplicationException, IOException
javax.ws.rs.WebApplicationExceptionIOExceptionpublic static boolean matchConsumeTypes(javax.ws.rs.core.MediaType requestContentType,
OperationResourceInfo ori)
public static boolean matchProduceTypes(javax.ws.rs.core.MediaType acceptContentType,
OperationResourceInfo ori)
public static boolean matchMimeTypes(javax.ws.rs.core.MediaType requestContentType,
javax.ws.rs.core.MediaType acceptContentType,
OperationResourceInfo ori)
public static List<javax.ws.rs.core.MediaType> intersectMimeTypes(List<javax.ws.rs.core.MediaType> requiredMediaTypes, List<javax.ws.rs.core.MediaType> userMediaTypes, boolean addRequiredParamsIfPossible)
mimeTypesA - mimeTypesB - public static List<javax.ws.rs.core.MediaType> intersectMimeTypes(List<javax.ws.rs.core.MediaType> requiredMediaTypes, List<javax.ws.rs.core.MediaType> userMediaTypes, boolean addRequiredParamsIfPossible, boolean addDistanceParameter)
public static List<javax.ws.rs.core.MediaType> intersectMimeTypes(List<javax.ws.rs.core.MediaType> mimeTypesA, javax.ws.rs.core.MediaType mimeTypeB)
public static List<javax.ws.rs.core.MediaType> intersectMimeTypes(String mimeTypesA, String mimeTypesB)
public static List<javax.ws.rs.core.MediaType> sortMediaTypes(String mediaTypes, String qs)
public static List<javax.ws.rs.core.MediaType> sortMediaTypes(List<javax.ws.rs.core.MediaType> types, String qs)
public static Class<?> getWebApplicationExceptionClass(javax.ws.rs.core.Response exResponse, Class<?> defaultExceptionType)
public static <T extends Throwable> javax.ws.rs.core.Response convertFaultToResponse(T ex, Message currentMessage)
public static void setMessageContentType(Message message, javax.ws.rs.core.Response response)
public static boolean propogateException(Message m)
public static boolean runContainerRequestFilters(ProviderFactory pf, Message m, boolean preMatch, List<String> names)
public static void runContainerResponseFilters(ProviderFactory pf, javax.ws.rs.core.Response r, Message m, OperationResourceInfo ori, Method invoked) throws IOException, Throwable
IOExceptionThrowablepublic static String mediaTypeToString(javax.ws.rs.core.MediaType mt, String... ignoreParams)
public static javax.ws.rs.core.MediaType toMediaType(String value)
public static javax.ws.rs.core.Response toResponse(int status)
public static javax.ws.rs.core.Response toResponse(javax.ws.rs.core.Response.Status status)
public static javax.ws.rs.core.Response.ResponseBuilder toResponseBuilder(int status)
public static javax.ws.rs.core.Response.ResponseBuilder toResponseBuilder(javax.ws.rs.core.Response.Status status)
public static javax.ws.rs.core.Response.ResponseBuilder fromResponse(javax.ws.rs.core.Response response)
public static javax.ws.rs.core.Response copyResponseIfNeeded(javax.ws.rs.core.Response response)
Apache CXF