This project will help you learn Kotlin programming language. You will find examples of common AEM developer tasks all written in both Java and Kotlin.
If you like to run it just type ./gradlew
from root folder or use provided Build and Deploy
build for IntelliJ IDE
-
SimpleService
Java | Kotlin
OSGi@Component
andService
(all in one class) with (static final field
in Java /companion object
- in Kotlin). -
SimpleServlet
Java | Kotlin
OSGi@Component
andSling Servlet
withdependency injection
to another service.
You can test both servlets on:
http://localhost:4502/bin/java/hello
http://localhost:4502/bin/kotlin/hello
-
ConfigurableService
Java | Kotlin
Serviceinterface
definition. -
ConfigurableServiceImpl
Java | Kotlin
OSGi component that can be configured inAdobe Experience Manager Web Console Configuration
.
Use of@ObjectClassDefinition
,@AttributeDefinition
and service implementation.
Compare how to transformArray
toMap
withStream API
in Java andClosures
in Kotlin. -
ComponentDecoratorFilter
Java | Kotlin
OSGi component and basic implementation ofjavax.servlet.Filter
-
ComponentDecoratorProcessor
Java | Kotlin
Class used by ComponentDecoratorFilter to replace markup text with some other text. Compare howfinal fields
are defined,casting
.
Meetelvis operator
andfields definition directly in constructor
when writing in Kotlin. -
SampleModel
Java | Kotlin
SimpleSling Model
with property and serviceinjection
. Learn how to inject primitive types in Kotlin. -
Sample Component
path
Sample Component with Touch UI config dialog. Add selectorjava
orkotlin
and switch fromJSP
toHTL
with different model implementations.