Language Support
Total Page:16
File Type:pdf, Size:1020Kb
Language Support Version 5.3.5 Table of Contents 1. Kotlin . 1 1.1. Requirements. 1 1.2. Extensions. 1 1.3. Null-safety. 2 1.4. Classes and Interfaces . 2 1.5. Annotations . 3 1.6. Bean Definition DSL . 3 1.7. Web . 5 1.7.1. Router DSL . 6 1.7.2. MockMvc DSL. 6 1.7.3. Kotlin Script Templates . 7 1.7.4. Kotlin multiplatform serialization . 8 1.8. Coroutines. 8 1.8.1. Dependencies . 9 1.8.2. How Reactive translates to Coroutines? . 9 1.8.3. Controllers . 10 1.8.4. WebFlux.fn . 11 1.8.5. Transactions. 12 1.9. Spring Projects in Kotlin . 13 1.9.1. Final by Default . 13 1.9.2. Using Immutable Class Instances for Persistence. 14 1.9.3. Injecting Dependencies . 15 1.9.4. Injecting Configuration Properties . 16 1.9.5. Checked Exceptions . 16 1.9.6. Annotation Array Attributes . 17 1.9.7. Testing . 17 Constructor injection . 18 PER_CLASS Lifecycle . 18 Specification-like Tests. 19 WebTestClient Type Inference Issue in Kotlin. 20 1.10. Getting Started . 20 1.10.1. start.spring.io . 20 1.10.2. Choosing the Web Flavor . 20 1.11. Resources . 21 1.11.1. Examples. 21 1.11.2. Issues . 21 2. Apache Groovy . 23 3. Dynamic Language Support . 24 3.1. A First Example. 24 3.2. Defining Beans that Are Backed by Dynamic Languages . 26 3.2.1. Common Concepts . 26 The <lang:language/> element . 27 Refreshable Beans. 27 Inline Dynamic Language Source Files . 30 Understanding Constructor Injection in the Context of Dynamic-language-backed Beans . 30 3.2.2. Groovy Beans . 31 Customizing Groovy Objects by Using a Callback . 33 3.2.3. BeanShell Beans . 34 3.3. Scenarios. 35 3.3.1. Scripted Spring MVC Controllers. 36 3.3.2. Scripted Validators . 37 3.4. Additional Details . 38 3.4.1. AOP — Advising Scripted Beans. 38 3.4.2. Scoping . ..