![JAR search and dependency download from the Maven repository](/logo.png)
org.apache.juneau.rest.config.BasicJson5Config 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.json.*;
import org.apache.juneau.rest.annotation.*;
import org.apache.juneau.serializer.annotation.*;
/**
* Basic configuration for a REST resource that supports JSON 5 transport.
*
*
* Default settings defined:
*
*
* - {@link Rest}:
*
* - {@link Rest#serializers() serializers}:
*
* - {@link Json5Serializer}
*
*
* - {@link Rest#parsers() parsers}:
*
* - {@link Json5Parser}
*
*
* - {@link Rest#defaultAccept() defaultAccept}:
"text/json5"
* - {@link Rest#config() config}:
"$S{juneau.configFile,SYSTEM_DEFAULT}"
*
*
* - {@link BeanConfig}:
*
* - {@link BeanConfig#ignoreUnknownBeanProperties() ignoreUnknownBeanProperties}:
"true"
*
*
* - {@link SerializerConfig}:
*
* - {@link SerializerConfig#uriResolution() uriResolution}:
"ROOT_RELATIVE"
*
*
*
*
*
* This annotation can be applied to REST resource classes to define common JSON default configurations:
*
*
* // Used on a top-level resource.
* @Rest
* public class MyResource extends RestServlet implements BasicJson5Config { ... }
*
*
* // Used on a child resource.
* @Rest
* public class MyResource extends RestObject implements BasicJson5Config { ... }
*
*
*
* 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:
*/
@Rest(
// Default serializers for all Java methods in the class.
serializers={
Json5Serializer.class,
},
// Default parsers for all Java methods in the class.
parsers={
Json5Parser.class,
},
// Optional external configuration file.
config="$S{juneau.configFile,SYSTEM_DEFAULT}"
)
public interface BasicJson5Config extends DefaultConfig {}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy