提交 6c7250b0 编写于 作者: S Sébastien Deleuze

Make Kotlin DSL class constructors internal

Closes gh-24059
上级 dc0ebefc
......@@ -76,7 +76,7 @@ fun beans(init: BeanDefinitionDsl.() -> Unit) = BeanDefinitionDsl(init)
* @author Sebastien Deleuze
* @since 5.0
*/
open class BeanDefinitionDsl(private val init: BeanDefinitionDsl.() -> Unit,
open class BeanDefinitionDsl internal constructor (private val init: BeanDefinitionDsl.() -> Unit,
private val condition: (ConfigurableEnvironment) -> Boolean = { true })
: ApplicationContextInitializer<GenericApplicationContext> {
......
......@@ -40,7 +40,7 @@ import javax.servlet.http.Cookie
* @author Sebastien Deleuze
* @since 5.2
*/
open class MockHttpServletRequestDsl(private val builder: MockHttpServletRequestBuilder) {
open class MockHttpServletRequestDsl internal constructor (private val builder: MockHttpServletRequestBuilder) {
/**
* @see [MockHttpServletRequestBuilder.contextPath]
......
......@@ -27,7 +27,7 @@ import javax.servlet.http.Part
* @author Sebastien Deleuze
* @since 5.2
*/
class MockMultipartHttpServletRequestDsl(private val builder: MockMultipartHttpServletRequestBuilder) : MockHttpServletRequestDsl(builder) {
class MockMultipartHttpServletRequestDsl internal constructor (private val builder: MockMultipartHttpServletRequestBuilder) : MockHttpServletRequestDsl(builder) {
/**
* @see [MockMultipartHttpServletRequestBuilder.file]
......
......@@ -26,7 +26,7 @@ import java.io.Writer
* @author Sebastien Deleuze
* @since 5.2
*/
class MockMvcResultHandlersDsl(private val actions: ResultActions) {
class MockMvcResultHandlersDsl internal constructor (private val actions: ResultActions) {
/**
* @see MockMvcResultHandlers.print
......
......@@ -25,7 +25,7 @@ import org.springframework.test.web.servlet.result.*
* @author Sebastien Deleuze
* @since 5.2
*/
class MockMvcResultMatchersDsl(private val actions: ResultActions) {
class MockMvcResultMatchersDsl internal constructor (private val actions: ResultActions) {
/**
* @see MockMvcResultMatchers.request
......
......@@ -8,7 +8,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders
* @author Sebastien Deleuze
* @since 5.2
*/
class ResultActionsDsl(private val actions: ResultActions, private val mockMvc: MockMvc) {
class ResultActionsDsl internal constructor (private val actions: ResultActions, private val mockMvc: MockMvc) {
/**
* Provide access to [MockMvcResultMatchersDsl] Kotlin DSL.
......
......@@ -63,7 +63,7 @@ fun coRouter(routes: (CoRouterFunctionDsl.() -> Unit)) =
* @author Sebastien Deleuze
* @since 5.2
*/
class CoRouterFunctionDsl(private val init: (CoRouterFunctionDsl.() -> Unit)) {
class CoRouterFunctionDsl internal constructor (private val init: (CoRouterFunctionDsl.() -> Unit)) {
@PublishedApi
internal val builder = RouterFunctions.route()
......
......@@ -60,7 +60,7 @@ fun router(routes: RouterFunctionDsl.() -> Unit) = RouterFunctionDsl(routes).bui
* @author Yevhenii Melnyk
* @since 5.0
*/
class RouterFunctionDsl(private val init: RouterFunctionDsl.() -> Unit) {
class RouterFunctionDsl internal constructor (private val init: RouterFunctionDsl.() -> Unit) {
@PublishedApi
internal val builder = RouterFunctions.route()
......
......@@ -58,7 +58,7 @@ fun router(routes: (RouterFunctionDsl.() -> Unit)) = RouterFunctionDsl(routes).b
* @author Sebastien Deleuze
* @since 5.2
*/
class RouterFunctionDsl(private val init: (RouterFunctionDsl.() -> Unit)) {
class RouterFunctionDsl internal constructor (private val init: (RouterFunctionDsl.() -> Unit)) {
@PublishedApi
internal val builder = RouterFunctions.route()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册