001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. You may obtain a copy of the License at * 006// * * 007// * http://www.apache.org/licenses/LICENSE-2.0 * 008// * * 009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.rest.jaxrs; 014 015import javax.ws.rs.*; 016import javax.ws.rs.ext.*; 017 018import org.apache.juneau.html.*; 019import org.apache.juneau.jso.*; 020import org.apache.juneau.json.*; 021import org.apache.juneau.rest.*; 022import org.apache.juneau.soap.*; 023import org.apache.juneau.urlencoding.*; 024import org.apache.juneau.xml.*; 025import org.apache.juneau.xmlschema.*; 026 027/** 028 * JAX-RS provider for the same serialize/parse support provided by the {@link BasicRestServlet} class. 029 * 030 * <h5 class='section'>See Also:</h5> 031 * <ul> 032 * <li class='link'>{@doc juneau-rest-server-jaxrs} 033 * </ul> 034 */ 035@Provider 036@Produces({ 037 "application/json", "text/json", // JsonSerializer 038 "application/json+simple", "text/json+simple", // JsonSerializer.Simple 039 "application/json+schema", // JsonSchemaSerializer 040 "text/xml", // XmlDocSerializer.Ns 041 "text/xml+simple", // XmlDocSerializer 042 "text/xml+schema", // XmlSchemaDocSerializer 043 "text/html", // HtmlDocSerializer 044 "application/x-www-form-urlencoded", // UrlEncodingSerializer 045 "text/xml+soap", // SoapXmlSerializer 046 "application/x-java-serialized-object" // JavaSerializedObjectSerializer 047}) 048@Consumes({ 049 "application/json", "text/json", // JsonParser 050 "text/xml", // XmlParser 051 "text/html", // HtmlParser 052 "application/x-www-form-urlencoded", // UrlEncodingParser 053 "application/x-java-serialized-object" // JavaSerializedObjectParser 054}) 055@JuneauProvider( 056 serializers={ 057 JsonSerializer.class, 058 SimpleJsonSerializer.class, 059 JsonSchemaSerializer.class, 060 XmlDocSerializer.Ns.class, 061 XmlDocSerializer.class, 062 XmlSchemaDocSerializer.class, 063 HtmlDocSerializer.class, 064 UrlEncodingSerializer.class, 065 SoapXmlSerializer.class, 066 JsoSerializer.class 067 }, 068 parsers={ 069 JsonParser.class, 070 XmlParser.class, 071 HtmlParser.class, 072 UrlEncodingParser.class, 073 } 074) 075public final class BasicProvider extends BaseProvider {} 076