![JAR search and dependency download from the Maven repository](/logo.png)
org.apache.juneau.rest.config.BasicUniversalConfig Maven / Gradle / Ivy
// ***************************************************************************************************************************
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
package org.apache.juneau.rest.config;
import org.apache.juneau.annotation.*;
import org.apache.juneau.csv.*;
import org.apache.juneau.html.*;
import org.apache.juneau.html.annotation.*;
import org.apache.juneau.json.*;
import org.apache.juneau.msgpack.*;
import org.apache.juneau.oapi.*;
import org.apache.juneau.plaintext.*;
import org.apache.juneau.rest.annotation.*;
import org.apache.juneau.rest.servlet.*;
import org.apache.juneau.serializer.annotation.*;
import org.apache.juneau.soap.*;
import org.apache.juneau.uon.*;
import org.apache.juneau.urlencoding.*;
import org.apache.juneau.xml.*;
/**
* Predefined configuration for a REST resource that supports all languages
* and provides common default configuration values.
*
*
* Default settings defined:
*
*
* - {@link Rest}:
*
* - {@link Rest#serializers() serializers}:
*
* - {@link HtmlDocSerializer}
*
- {@link HtmlStrippedDocSerializer}
*
- {@link HtmlSchemaDocSerializer}
*
- {@link JsonSerializer}
*
- {@link Json5Serializer}
*
- {@link JsonSchemaSerializer}
*
- {@link XmlDocSerializer}
*
- {@link UonSerializer}
*
- {@link UrlEncodingSerializer}
*
- {@link OpenApiSerializer}
*
- {@link MsgPackSerializer}
*
- {@link SoapXmlSerializer}
*
- {@link PlainTextSerializer}
*
*
* - {@link Rest#parsers() parsers}:
*
* - {@link JsonParser}
*
- {@link Json5Parser}
*
- {@link XmlParser}
*
- {@link HtmlParser}
*
- {@link UonParser}
*
- {@link UrlEncodingParser}
*
- {@link OpenApiParser}
*
- {@link MsgPackParser}
*
- {@link PlainTextParser}
*
*
* - {@link Rest#config() config}:
"$S{juneau.configFile,SYSTEM_DEFAULT}"
*
*
* - {@link BeanConfig}:
*
* - {@link BeanConfig#ignoreUnknownBeanProperties() ignoreUnknownBeanProperties}:
"true"
*
*
* - {@link SerializerConfig}:
*
* - {@link SerializerConfig#uriResolution() uriResolution}:
"ROOT_RELATIVE"
*
*
* - {@link HtmlDocConfig}:
*
* - {@link HtmlDocConfig#header() header}:
"<h1>$RS{title}</h1><h2>$RS{operationSummary,description}</h2>$C{REST/header}"
* - {@link HtmlDocConfig#navlinks() navlinks}:
"up: request:/.."
* - {@link HtmlDocConfig#stylesheet() stylesheet}:
"$C{REST/theme,servlet:/htdocs/themes/devops.css}"
* - {@link HtmlDocConfig#head() head}:
"$C{REST/head}"
* - {@link HtmlDocConfig#footer() footer}:
"$C{REST/footer}"
* - {@link HtmlDocConfig#nowrap() nowrap}:
"true"
*
*
*
*
*
* This annotation can be applied to REST resource classes to define common default configurations:
*
*
* // Used on a top-level resource.
* @Rest
* public class MyResource extends RestServlet implements BasicUniversalConfig { ... }
*
*
* // Used on a child resource.
* @Rest
* public class MyResource extends RestObject implements BasicUniversalConfig { ... }
*
*
*
* Note that the framework will aggregate annotations defined on all classes in the class hierarchy with
* values defined on child classes overriding values defined on parent classes. That allows any values defined
* on this interface to be overridden by annotations defined on the implemented class.
*
*
* See Also:
*
* - {@link BasicRestServlet}
*
- {@link BasicRestServletGroup}
*
- {@link BasicRestObject}
*
- {@link BasicRestObjectGroup}
*
* - @Rest-Annotated Classes
*
*/
@Rest(
// Default serializers for all Java methods in the class.
serializers={
HtmlDocSerializer.class, // HTML must be listed first because Internet Explore does not include text/html in their Accept header.
HtmlStrippedDocSerializer.class,
HtmlSchemaDocSerializer.class,
JsonSerializer.class,
Json5Serializer.class,
JsonSchemaSerializer.class,
XmlDocSerializer.class,
UonSerializer.class,
UrlEncodingSerializer.class,
OpenApiSerializer.class,
MsgPackSerializer.class,
SoapXmlSerializer.class,
PlainTextSerializer.class,
CsvSerializer.class
},
// Default parsers for all Java methods in the class.
parsers={
JsonParser.class,
Json5Parser.class,
XmlParser.class,
HtmlParser.class,
UonParser.class,
UrlEncodingParser.class,
OpenApiParser.class,
MsgPackParser.class,
PlainTextParser.class,
CsvParser.class
}
)
public interface BasicUniversalConfig extends DefaultConfig, DefaultHtmlConfig {}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy