提交 a3e62284 编写于 作者: R Rossen Stoyanchev

Create Languages section

Issue: SPR-16044
上级 c80aa833
......@@ -3868,7 +3868,7 @@ Notice how the `InstantiationTracingBeanPostProcessor` is simply defined. It doe
even have a name, and because it is a bean it can be dependency-injected just like any
other bean. (The preceding configuration also defines a bean that is backed by a Groovy
script. The Spring dynamic language support is detailed in the chapter entitled
<<integration.adoc#dynamic-language, Dynamic language support>>.)
<<languages.adoc#dynamic-language, Dynamic language support>>.)
The following simple Java application executes the preceding code and configuration:
......
......@@ -40,7 +40,7 @@ at runtime.
They are also used to make Spring API null-safe in Kotlin projects since Kotlin natively
supports https://kotlinlang.org/docs/reference/null-safety.html[null-safety]. More details
are available in <<kotlin#null-safety,Kotlin support documentation>>.
are available in <<languages#kotlin-null-safety,Kotlin support documentation>>.
== JSR 305 meta-annotations
......
......@@ -22,5 +22,5 @@ ORM, Marshalling XML.
<<web-reactive.adoc#spring-webflux,Web Reactive>> :: Spring WebFlux,
WebClient, WebSocket.
<<integration.adoc#spring-integration,Integration>> :: Remoting, JMS, JCA, JMX, Email,
Tasks, Scheduling, Cache, Dynamic languages.
<<kotlin.adoc#kotlin,Kotlin>> :: Extensions, Bean Definition DSL, WebFlux DSL.
Tasks, Scheduling, Cache.
<<languages.adoc#languages,Languages>> :: Kotlin, Groovy, Dynamic languages.
......@@ -258,35 +258,6 @@ After...
[[xsd-schemas-lang]]
=== The lang schema
The `lang` tags deal with exposing objects that have been written in a dynamic language
such as JRuby or Groovy as beans in the Spring container.
These tags (and the dynamic language support) are comprehensively covered in the chapter
entitled <<integration.adoc#dynamic-language,Dynamic language support>>.
Please do consult that chapter for full details on this support and the `lang` tags themselves.
In the interest of completeness, to use the tags in the `lang` schema, you need to have
the following preamble at the top of your Spring XML configuration file; the text in the
following snippet references the correct schema so that the tags in the `lang` namespace
are available to you.
[source,xml,indent=0]
[subs="verbatim,quotes"]
----
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
__xmlns:lang="http://www.springframework.org/schema/lang"__ xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
__http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd"__> <!-- bean definitions here -->
</beans>
----
[[xsd-schemas-jms]]
=== The jms schema
......
此差异已折叠。
[[lanugages]]
= Language Support
:doc-root: https://docs.spring.io
:api-spring-framework: {doc-root}/spring-framework/docs/{spring-version}/javadoc-api/org/springframework
:toc: left
:toclevels: 4
:docinfo1:
include::languages/kotlin.adoc[leveloffset=+1]
include::languages/groovy.adoc[leveloffset=+1]
include::languages/dynamic-languages.adoc[leveloffset=+1]
此差异已折叠。
[[groovy]]
= Apache Groovy
Groovy is a powerful, optionally typed and dynamic language, with static-typing and static
compilation capabilities. It offers a concise syntax and integrates smoothly with any
existing Java application.
The Spring Framework provides a dedicated `ApplicationContext` that supports a Groovy-based
Bean Definition DSL. For more details, see
<<core.adoc#groovy-bean-definition-dsl,The Groovy Bean Definition DSL>>.
Further support for Groovy including beans written in Groovy, refreshable script beans,
and more is available in next the section <<dynamic-language>>.
[[kotlin]]
= Kotlin support
:doc-root: https://docs.spring.io
:api-spring-framework: {doc-root}/spring-framework/docs/{spring-version}/javadoc-api/org/springframework
:toc: left
:toclevels: 4
:docinfo1:
[[introduction]]
== Introduction
= Kotlin
https://kotlinlang.org[Kotlin] is a statically-typed language targeting the JVM (and other platforms)
which allows writing concise and elegant code while providing very good
https://kotlinlang.org/docs/reference/java-interop.html[interoperability] with
existing libraries written in Java.
Spring Framework 5 introduces first-class support for Kotlin and allows developers to write
Spring + Kotlin applications almost as if the Spring Framework was a native Kotlin framework.
The Spring Framework provides first-class support for Kotlin that allows developers to write
Kotlin applications almost as if the Spring Framework was a native Kotlin framework.
[[requirements]]
[[kotlin-requirements]]
== Requirements
Spring Framework supports Kotlin 1.1+ and requires
......@@ -37,7 +26,7 @@ https://start.spring.io/#!language=kotlin[start.spring.io].
[[extensions]]
[[kotlin-extensions]]
== Extensions
Kotlin https://kotlinlang.org/docs/reference/extensions.html[extensions] provide the ability
......@@ -89,7 +78,7 @@ for shorter syntax.
[[null-safety]]
[[kotlin-null-safety]]
== Null-safety
One of Kotlin's key features is https://kotlinlang.org/docs/reference/null-safety.html[null-safety]
......@@ -132,7 +121,7 @@ for up-to-date information.
[[classes-interfaces]]
[[kotlin-classes-interfaces]]
== Classes & Interfaces
Spring Framework supports various Kotlin constructs like instantiating Kotlin classes
......@@ -156,7 +145,7 @@ As of Spring Boot 2.0, Jackson Kotlin module is automatically provided via the J
[[annotations]]
[[kotlin-annotations]]
== Annotations
Spring Framework also takes advantage of https://kotlinlang.org/docs/reference/null-safety.html[Kotlin null-safety]
......@@ -173,7 +162,7 @@ won’t raise an error if such bean does not exist.
[[bean-definition-dsl]]
[[kotlin-bean-definition-dsl]]
== Bean definition DSL
Spring Framework 5 introduces a new way to register beans in a functional way using lambdas
......@@ -275,7 +264,7 @@ for more details and up-to-date information.
[[web]]
[[kotlin-web]]
== Web
......@@ -357,7 +346,7 @@ project for more details.
[[spring-projects-in-kotlin]]
[[kotlin-spring-projects-in-kotlin]]
== Spring projects in Kotlin
This section provides focus on some specific hints and recommendations worth
......@@ -667,7 +656,7 @@ class SpecificationLikeTests {
[[getting-started]]
[[kotlin-getting-started]]
== Getting started
......@@ -697,7 +686,7 @@ MVC and its annotation-based programming model is a perfectly valid and fully su
[[resources-started]]
[[kotlin-resources-started]]
== Resources
* http://kotlinlang.org/docs/reference/[Kotlin language reference]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册