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 |
IGNORE_MESSAGE_WRITERS |
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 |
compareMediaTypesQualityFactors(javax.ws.rs.core.MediaType mt1,
javax.ws.rs.core.MediaType mt2) |
static int |
compareSortedMediaTypes(List<javax.ws.rs.core.MediaType> mts1,
List<javax.ws.rs.core.MediaType> mts2) |
static <T extends Throwable> |
convertFaultToResponse(T ex,
Message inMessage) |
static QName |
convertStringToQName(String name) |
static javax.ws.rs.core.Response |
copyResponseIfNeeded(javax.ws.rs.core.Response response) |
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 boolean |
headMethodPossible(String expectedMethod,
String httpMethod) |
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> 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) |
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 String |
removeMediaTypeParameter(javax.ws.rs.core.MediaType mt,
String paramName) |
static ClassResourceInfo |
selectResourceClass(List<ClassResourceInfo> resources,
String path,
javax.ws.rs.core.MultivaluedMap<String,String> values,
Message message) |
static List<javax.ws.rs.core.MediaType> |
sortMediaTypes(List<javax.ws.rs.core.MediaType> types) |
static List<javax.ws.rs.core.MediaType> |
sortMediaTypes(String mediaTypes) |
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) |
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 DOC_LOCATION
public static final String DEFAULT_PROVIDERS_FOR_SIMPLE_TYPES
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 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 compareSortedMediaTypes(List<javax.ws.rs.core.MediaType> mts1, List<javax.ws.rs.core.MediaType> mts2)
public static int compareMediaTypes(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)
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 <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 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> 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(List<javax.ws.rs.core.MediaType> types)
public static <T extends Throwable> javax.ws.rs.core.Response convertFaultToResponse(T ex, Message inMessage)
public static String removeMediaTypeParameter(javax.ws.rs.core.MediaType mt, String paramName)
public static boolean propogateException(Message m)
public static String mediaTypeToString(javax.ws.rs.core.MediaType mt)
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