Package-Level Annotations in Kotlin ( for JAXB)


Hi everyone,
does Kotlin support annotations on package-level? I’m struggling with the conversion of the following Java code into Kotlin. It’s a typical that is used by JAXB.

xmlns = {
@XmlNs(prefix = “”, namespaceURI = Constants.XML_NAMESPACE_SPRD_URL),
@XmlNs(prefix = Constants.XML_NAMESPACE_XLINK, namespaceURI = Constants.XML_NAMESPACE_XLINK_URL)
namespace = Constants.XML_NAMESPACE_SPRD_URL,
elementFormDefault = XmlNsForm.QUALIFIED)
package net.sprd.exos.api.model;

import my.package.Constants;

import javax.xml.bind.annotation.XmlNs;
import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlSchema;

Looking forward to your response!
Cheers Philipp


No, it doesn’t. You can simply leave as a Java file in your project.